/** * Adds a new fileName in the list of files making up this index * @param fileName */ void addFileName(final String fileName) { writeLock.lock(); try { final FileListCacheValue fileList = getFileList(); boolean done = fileList.add(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: added " + fileName); } } finally { writeLock.unlock(); } }
/** * Optimized implementation to perform both a remove and an add * @param toRemove * @param toAdd */ public void removeAndAdd(final String toRemove, final String toAdd) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.addAndRemove(toAdd, toRemove); if (done) { updateFileList(fileList); if (trace) { log.trace("Updated file listing: added " + toAdd + " and removed " + toRemove); } } } finally { writeLock.unlock(); } }
/** * Optimized implementation to perform both a remove and an add * @param toRemove * @param toAdd */ public void removeAndAdd(final String toRemove, final String toAdd) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.addAndRemove(toAdd, toRemove); if (done) { updateFileList(fileList); if (trace) { log.trace("Updated file listing: added " + toAdd + " and removed " + toRemove); } } } finally { writeLock.unlock(); } }
/** * Adds a new fileName in the list of files making up this index * @param fileName */ void addFileName(final String fileName) { writeLock.lock(); try { final FileListCacheValue fileList = getFileList(); boolean done = fileList.add(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: added " + fileName); } } finally { writeLock.unlock(); } }
/** * Deleted a file from the list of files actively part of the index * @param fileName */ public void deleteFileName(final String fileName) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.remove(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: removed " + fileName); } } finally { writeLock.unlock(); } }
/** * Deleted a file from the list of files actively part of the index * @param fileName */ public void deleteFileName(final String fileName) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.remove(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: removed " + fileName); } } finally { writeLock.unlock(); } }