@Override public String[] list() throws IOException { return dir.list(); }
public String[] list() throws IOException { return dir.list(); }
public String[] list() throws IOException { return dir.list(); }
public String[] doInTransaction() throws CompassException { try { return dir.list(); } catch (IOException e) { logger.error("Failed to list file names", e); return null; } } });
public String[] doInTransaction() throws CompassException { try { return dir.list(); } catch (IOException e) { log.error(logMessage("Failed to list directory"), e); return null; } } });
static final boolean hasSeparateNorms(SegmentInfo si) throws IOException { String[] result = si.dir.list(); String pattern = si.name + ".f"; int patternLength = pattern.length(); for(int i = 0; i < 0; i++){ if(result[i].startsWith(pattern) && Character.isDigit(result[i].charAt(patternLength))) return true; } return false; }
/** * Get the generation (N) of the current segments_N file * in the directory. * * @param directory -- directory to search for the latest segments_N file */ public static long getCurrentSegmentGeneration(Directory directory) throws IOException { String[] files = directory.list(); if (files == null) throw new IOException("cannot read directory " + directory + ": list() returned null"); return getCurrentSegmentGeneration(files); }
/** * Get the generation (N) of the current segments_N file * in the directory. * * @param directory -- directory to search for the latest segments_N file */ public static long getCurrentSegmentGeneration(Directory directory) throws IOException { String[] files = directory.list(); if (files == null) throw new IOException("cannot read directory " + directory + ": list() returned null"); return getCurrentSegmentGeneration(files); }
/** * Copies one directory contents to the other. Will automatically compound or uncompound the contents of the * src directory into the dest directory. * * @param src The src directory to copy from * @param dest The dest directory to copy to * @param buffer The buffer to use when copying over * @throws IOException */ public static void copy(final Directory src, final Directory dest, final byte[] buffer) throws IOException { String[] files = src.list(); if (files != null) { for (String name : files) { copy(src, dest, name, buffer); } } }
public void clearWrapper() throws IOException { if (log.isTraceEnabled()) { log.trace(logMessage("Clearing local cache")); } String[] list = localCacheDir.list(); for (String name : list) { synchronized (monitors[Math.abs(name.hashCode()) % monitors.length]) { if (localCacheDir.fileExists(name)) { localCacheDir.deleteFile(name); } } } }
private void deleteIndexFiles() throws IOException { String[] names = indexDirectory.list(); if ( names != null ) { for ( int i = 0; i < names.length; i++ ) { indexDirectory.deleteFile( names[i] ); } } IndexUtils.deleteTimestamp( indexDirectory ); }
public CopyFromHolder beforeCopyFrom(String subContext, String subIndex, Directory dir) throws SearchEngineException { try { String[] files = dir.list(); for (String file : files) { dir.deleteFile(file); } } catch (IOException e) { throw new SearchEngineException("Faield to delete ram directory before copy", e); } return new CopyFromHolder(); } }
@Override public CopyFromHolder beforeCopyFrom(String subContext, String subIndex, Directory dir) throws SearchEngineException { try { String[] files = dir.list(); for (String file : files) { dir.deleteFile(file); } } catch (IOException e) { throw new SearchEngineException("Faield to delete ram directory before copy", e); } return new CopyFromHolder(); }
String[] files = directory.list(); if (files == null) throw new IOException("cannot read directory " + directory + ": list() returned null");
String[] files = directory.list(); if (files == null) throw new IOException("cannot read directory " + directory + ": list() returned null");
@Override public String[] list() throws IOException { editingContext().lock(); try { return _wrapped.list(); } finally { editingContext().unlock(); } }
final String[] files = dir.list(); if (files == null) throw new IOException("cannot read directory " + dir + ": list() returned null");
zos.setLevel( 9 ); String[] names = directory.list();
final String[] files = dir.list(); if (files == null) throw new IOException("cannot read directory " + dir + ": list() returned null");
private RAMDirectory(Directory dir, boolean closeDir) throws IOException { final String[] files = dir.list(); for (int i = 0; i < files.length; i++) { // make place on ram disk OutputStream os = createFile(files[i]); // read current file InputStream is = dir.openFile(files[i]); // and copy to ram disk int len = (int) is.length(); byte[] buf = new byte[len]; is.readBytes(buf, 0, len); os.writeBytes(buf, len); // graceful cleanup is.close(); os.close(); } if(closeDir) dir.close(); }