/** * Invalidate called externally. * @param key to invalidate */ protected void invalidate(String key) { // Check if not already scheduled for deletion if (!attic.containsKey(key) && map.containsKey(key)) { try { LOG.debug("Invalidating [{}]", key); File toBeDeleted = map.get(key); deleteInternal(key, toBeDeleted); map.remove(key, toBeDeleted); } catch (IOException e) { LOG.warn("Could not delete file from staging", e); } } }
/** * Invalidate called externally. * @param key to invalidate */ protected void invalidate(String key) { // Check if not already scheduled for deletion if (!attic.containsKey(key) && map.containsKey(key)) { try { LOG.debug("Invalidating [{}]", key); File toBeDeleted = map.get(key); deleteInternal(key, toBeDeleted); map.remove(key, toBeDeleted); } catch (IOException e) { LOG.warn("Could not delete file from staging", e); } } }
/** * Invalidate called externally. * @param key to invalidate */ protected void invalidate(String key) { // Check if not already scheduled for deletion if (!attic.containsKey(key) && map.containsKey(key)) { try { LOG.debug("Invalidating [{}]", key); File toBeDeleted = map.get(key); deleteInternal(key, toBeDeleted); map.remove(key, toBeDeleted); } catch (IOException e) { LOG.warn("Could not delete file from staging", e); } } }
/** * Removes all cached from attic */ private void remove() { LOG.info("Starting purge of uploaded files"); Iterator<String> iterator = attic.keySet().iterator(); int count = 0; while (iterator.hasNext()) { String key = iterator.next(); try { // Check if not already scheduled for upload if (!map.containsKey(key)) { LOG.trace("upload map contains id [{}]", key); File toBeDeleted = attic.get(key); deleteInternal(key, toBeDeleted); iterator.remove(); LOG.debug("Cache [{}] file deleted for id [{}]", toBeDeleted, key); count++; } } catch (IOException e) { LOG.error("Error in removing entry for id [{}]", key); } } LOG.info("Finished removal of [{}] files", count); }
/** * Removes all cached from attic */ private void remove() { LOG.info("Starting purge of uploaded files"); Iterator<String> iterator = attic.keySet().iterator(); int count = 0; while (iterator.hasNext()) { String key = iterator.next(); try { // Check if not already scheduled for upload if (!map.containsKey(key)) { LOG.trace("upload map contains id [{}]", key); File toBeDeleted = attic.get(key); deleteInternal(key, toBeDeleted); iterator.remove(); LOG.debug("Cache [{}] file deleted for id [{}]", toBeDeleted, key); count++; } } catch (IOException e) { LOG.error("Error in removing entry for id [{}]", key); } } LOG.info("Finished removal of [{}] files", count); }
/** * Removes all cached from attic */ private void remove() { LOG.info("Starting purge of uploaded files"); Iterator<String> iterator = attic.keySet().iterator(); int count = 0; while (iterator.hasNext()) { String key = iterator.next(); try { // Check if not already scheduled for upload if (!map.containsKey(key)) { LOG.trace("upload map contains id [{}]", key); File toBeDeleted = attic.get(key); deleteInternal(key, toBeDeleted); iterator.remove(); LOG.debug("Cache [{}] file deleted for id [{}]", toBeDeleted, key); count++; } } catch (IOException e) { LOG.error("Error in removing entry for id [{}]", key); } } LOG.info("Finished removal of [{}] files", count); }