Skip to content

Commit

Permalink
Remove unthrown exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed Apr 27, 2015
1 parent 24edb8c commit 7edad2b
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions src/main/java/org/fcrepo/audit/InternalAuditor.java
Expand Up @@ -134,32 +134,28 @@ public void register() throws RepositoryRuntimeException {
*/
@Subscribe
public void recordEvent(final FedoraEvent event) throws RepositoryRuntimeException, IOException {
try {
LOGGER.debug("Event detected: {} {}", event.getUserID(), event.getPath());
boolean isParentNodeLastModifiedEvent = false;
final String eventType = AuditUtils.getEventURIs(event.getTypes());
final Set<String> properties = event.getProperties();
if (eventType.contains(AuditProperties.PROPERTY_CHANGED)) {
isParentNodeLastModifiedEvent = true;
final Iterator<String> propertiesIter = properties.iterator();
String property;
while (properties.iterator().hasNext()) {
property = propertiesIter.next();
if (!property.equals(AuditProperties.LAST_MODIFIED) &&
!property.equals(AuditProperties.LAST_MODIFIED_BY)) {
/* adding/removing a file updates the lastModified property of the parent container,
so ignore updates when only lastModified is changed */
isParentNodeLastModifiedEvent = false;
break;
}
LOGGER.debug("Event detected: {} {}", event.getUserID(), event.getPath());
boolean isParentNodeLastModifiedEvent = false;
final String eventType = AuditUtils.getEventURIs(event.getTypes());
final Set<String> properties = event.getProperties();
if (eventType.contains(AuditProperties.PROPERTY_CHANGED)) {
isParentNodeLastModifiedEvent = true;
final Iterator<String> propertiesIter = properties.iterator();
String property;
while (properties.iterator().hasNext()) {
property = propertiesIter.next();
if (!property.equals(AuditProperties.LAST_MODIFIED) &&
!property.equals(AuditProperties.LAST_MODIFIED_BY)) {
/* adding/removing a file updates the lastModified property of the parent container,
so ignore updates when only lastModified is changed */
isParentNodeLastModifiedEvent = false;
break;
}
}
if (!event.getPath().startsWith(AUDIT_CONTAINER_LOCATION)
&& !isParentNodeLastModifiedEvent) {
createAuditNode(event);
}
} catch (RepositoryException e) {
throw new RepositoryRuntimeException(e);
}
if (!event.getPath().startsWith(AUDIT_CONTAINER_LOCATION)
&& !isParentNodeLastModifiedEvent) {
createAuditNode(event);
}
}

Expand Down

0 comments on commit 7edad2b

Please sign in to comment.