if (watchedResource.exists()) { resourceExist = true; lastModification = watchedResource.getLastModifiedTime(); } else { resourceExist = false;
/** {@inheritDoc} */ protected byte[] fetchMetadata() throws MetadataProviderException { try { DateTime metadataUpdateTime = metadataResource.getLastModifiedTime(); log.debug("resource {} was last modified {}", metadataResource.getLocation(), metadataUpdateTime); if (getLastRefresh() == null || metadataUpdateTime.isAfter(getLastRefresh())) { return inputstreamToByteArray(metadataResource.getInputStream()); } return null; } catch (ResourceException e) { String errorMsg = "Unable to read metadata file"; log.error(errorMsg, e); throw new MetadataProviderException(errorMsg, e); } } }
resourceExist = true; signalListeners(ResourceChange.CREATION); lastModification = watchedResource.getLastModifiedTime(); } else { if (lastModification.isBefore(watchedResource.getLastModifiedTime())) { signalListeners(ResourceChange.UPDATE); lastModification = watchedResource.getLastModifiedTime();