/** Returns an array of strings, one for each file in the directory. */ @Override public String[] listAll() { ensureOpen(); String[] res = entries.keySet().toArray(new String[entries.size()]); // Add the segment name for (int i = 0; i < res.length; i++) { res[i] = segmentName + res[i]; } return res; }
/** Returns the length of a file in the directory. * @throws IOException if the file does not exist */ @Override public long fileLength(String name) throws IOException { ensureOpen(); FileEntry e = entries.get(IndexFileNames.stripSegmentName(name)); if (e == null) throw new FileNotFoundException(name); return e.length; }
@Override public IndexInput openInput(String name, IOContext context) throws IOException { ensureOpen(); final String id = IndexFileNames.stripSegmentName(name); final FileEntry entry = entries.get(id); if (entry == null) { String datFileName = IndexFileNames.segmentFileName(segmentName, "", Lucene50CompoundFormat.DATA_EXTENSION); throw new FileNotFoundException("No sub-file with id " + id + " found in compound file \"" + datFileName + "\" (fileName=" + name + " files: " + entries.keySet() + ")"); } return handle.slice(name, entry.offset, entry.length); }
/** Returns an array of strings, one for each file in the directory. */ @Override public String[] listAll() { ensureOpen(); String[] res = entries.keySet().toArray(new String[entries.size()]); // Add the segment name for (int i = 0; i < res.length; i++) { res[i] = segmentName + res[i]; } return res; }
/** Returns an array of strings, one for each file in the directory. */ @Override public String[] listAll() { ensureOpen(); String[] res = entries.keySet().toArray(new String[entries.size()]); // Add the segment name for (int i = 0; i < res.length; i++) { res[i] = segmentName + res[i]; } return res; }
/** Returns an array of strings, one for each file in the directory. */ @Override public String[] listAll() { ensureOpen(); String[] res = entries.keySet().toArray(new String[entries.size()]); // Add the segment name for (int i = 0; i < res.length; i++) { res[i] = segmentName + res[i]; } return res; }
/** Returns the length of a file in the directory. * @throws IOException if the file does not exist */ @Override public long fileLength(String name) throws IOException { ensureOpen(); FileEntry e = entries.get(IndexFileNames.stripSegmentName(name)); if (e == null) throw new FileNotFoundException(name); return e.length; }
/** Returns the length of a file in the directory. * @throws IOException if the file does not exist */ @Override public long fileLength(String name) throws IOException { ensureOpen(); FileEntry e = entries.get(IndexFileNames.stripSegmentName(name)); if (e == null) throw new FileNotFoundException(name); return e.length; }
/** Returns the length of a file in the directory. * @throws IOException if the file does not exist */ @Override public long fileLength(String name) throws IOException { ensureOpen(); FileEntry e = entries.get(IndexFileNames.stripSegmentName(name)); if (e == null) throw new FileNotFoundException(name); return e.length; }
@Override public IndexInput openInput(String name, IOContext context) throws IOException { ensureOpen(); final String id = IndexFileNames.stripSegmentName(name); final FileEntry entry = entries.get(id); if (entry == null) { throw new FileNotFoundException("No sub-file with id " + id + " found (fileName=" + name + " files: " + entries.keySet() + ")"); } return handle.slice(name, entry.offset, entry.length); }
@Override public IndexInput openInput(String name, IOContext context) throws IOException { ensureOpen(); final String id = IndexFileNames.stripSegmentName(name); final FileEntry entry = entries.get(id); if (entry == null) { throw new FileNotFoundException("No sub-file with id " + id + " found (fileName=" + name + " files: " + entries.keySet() + ")"); } return handle.slice(name, entry.offset, entry.length); }
@Override public IndexInput openInput(String name, IOContext context) throws IOException { ensureOpen(); final String id = IndexFileNames.stripSegmentName(name); final FileEntry entry = entries.get(id); if (entry == null) { String datFileName = IndexFileNames.segmentFileName(segmentName, "", Lucene50CompoundFormat.DATA_EXTENSION); throw new FileNotFoundException("No sub-file with id " + id + " found in compound file \"" + datFileName + "\" (fileName=" + name + " files: " + entries.keySet() + ")"); } return handle.slice(name, entry.offset, entry.length); }