public String[] listCachedFiles() { return cache.listAll(); }
@Override public synchronized String[] listAll() throws IOException { final Set<String> files = new HashSet<>(); for(String f : cache.listAll()) { files.add(f); } for(String f : in.listAll()) { files.add(f); } String[] result = files.toArray(new String[files.size()]); Arrays.sort(result); return result; }
/** Close this directory, which flushes any cached files * to the delegate and then closes the delegate. */ @Override public void close() throws IOException { // NOTE: technically we shouldn't have to do this, ie, // IndexWriter should have sync'd all files, but we do // it for defensive reasons... or in case the app is // doing something custom (creating outputs directly w/o // using IndexWriter): boolean success = false; try { if (cache.isOpen) { for(String fileName : cache.listAll()) { unCache(fileName); } } success = true; } finally { if (success) { IOUtils.close(cache, in); } else { IOUtils.closeWhileHandlingException(cache, in); } } }
public String[] listCachedFiles() { return cache.listAll(); }
public String[] listCachedFiles() { return cache.listAll(); }
public String[] listCachedFiles() { return cache.listAll(); }
@Override public synchronized String[] listAll() throws IOException { final Set<String> files = new HashSet<>(); for(String f : cache.listAll()) { files.add(f); } for(String f : in.listAll()) { files.add(f); } return files.toArray(new String[files.size()]); }
@Override public synchronized String[] listAll() throws IOException { final Set<String> files = new HashSet<>(); for(String f : cache.listAll()) { files.add(f); } for(String f : in.listAll()) { files.add(f); } return files.toArray(new String[files.size()]); }
@Override public synchronized String[] listAll() throws IOException { final Set<String> files = new HashSet<>(); for(String f : cache.listAll()) { files.add(f); } for(String f : in.listAll()) { files.add(f); } String[] result = files.toArray(new String[files.size()]); Arrays.sort(result); return result; }
/** Close this directory, which flushes any cached files * to the delegate and then closes the delegate. */ @Override public void close() throws IOException { // NOTE: technically we shouldn't have to do this, ie, // IndexWriter should have sync'd all files, but we do // it for defensive reasons... or in case the app is // doing something custom (creating outputs directly w/o // using IndexWriter): boolean success = false; try { if (cache.isOpen) { for(String fileName : cache.listAll()) { unCache(fileName); } } success = true; } finally { if (success) { IOUtils.close(cache, in); } else { IOUtils.closeWhileHandlingException(cache, in); } } }
/** Close this directory, which flushes any cached files * to the delegate and then closes the delegate. */ @Override public void close() throws IOException { // NOTE: technically we shouldn't have to do this, ie, // IndexWriter should have sync'd all files, but we do // it for defensive reasons... or in case the app is // doing something custom (creating outputs directly w/o // using IndexWriter): boolean success = false; try { if (cache.isOpen) { for(String fileName : cache.listAll()) { unCache(fileName); } } success = true; } finally { if (success) { IOUtils.close(cache, in); } else { IOUtils.closeWhileHandlingException(cache, in); } } }
/** Close this directory, which flushes any cached files * to the delegate and then closes the delegate. */ @Override public void close() throws IOException { // NOTE: technically we shouldn't have to do this, ie, // IndexWriter should have sync'd all files, but we do // it for defensive reasons... or in case the app is // doing something custom (creating outputs directly w/o // using IndexWriter): boolean success = false; try { if (cache.isOpen) { for(String fileName : cache.listAll()) { unCache(fileName); } } success = true; } finally { if (success) { IOUtils.close(cache, in); } else { IOUtils.closeWhileHandlingException(cache, in); } } }