@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { in.copyFrom(from, src, dest, context); createdFileNames.add(dest); }
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { writeLock.ensureValid(); in.copyFrom(from, src, dest, context); }
directory.copyFrom(info.info.dir, file, newFileName, context); copiedFiles.add(newFileName);
private void copy(Directory src, Directory to) throws IOException { for (String file : src.listAll()) { src.copyFrom(src, file, to.toString(), IOContext.DEFAULT); } }
in.copyFrom(new FilterDirectory(from) { @Override public IndexInput openInput(String name, IOContext context) throws IOException {
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { in.copyFrom(from, src, dest, context); createdFileNames.add(dest); }
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { in.copyFrom(from, src, dest, context); createdFileNames.add(dest); }
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { in.copyFrom(from, src, dest, context); createdFileNames.add(dest); }
public void copyToDirectory(Directory directory) throws IOException { for (String file : this.listAll()) { directory.copyFrom(this, file, file, IOContext.DEFAULT); } }
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { writeLock.ensureValid(); in.copyFrom(from, src, dest, context); }
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { writeLock.ensureValid(); in.copyFrom(from, src, dest, context); }
@Override public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException { writeLock.ensureValid(); in.copyFrom(from, src, dest, context); }
public static boolean copyFile( Directory source, Directory target, String srcName, String targetName ) throws IOException { try { source.fileLength( srcName ); // instead of fileExists } catch ( FileNotFoundException | NoSuchFileException e ) { return false; } target.copyFrom( source, srcName, targetName, IOContext.DEFAULT ); return true; }
public static boolean copyFile( Directory source, Directory target, String srcName, String targetName ) throws IOException { try { source.fileLength( srcName ); // instead of fileExists } catch ( FileNotFoundException | NoSuchFileException e ) { return false; } target.copyFrom( source, srcName, targetName, IOContext.DEFAULT ); return true; }
/** * Returns a new Directory instance, using the specified random * with contents copied from the provided directory. See * {@link #newDirectory()} for more information. */ public static BaseDirectoryWrapper newDirectory(Random r, Directory d) throws IOException { Directory impl = newDirectoryImpl(r, TEST_DIRECTORY); for (String file : d.listAll()) { if (file.startsWith(IndexFileNames.SEGMENTS) || IndexFileNames.CODEC_FILE_PATTERN.matcher(file).matches()) { impl.copyFrom(d, file, file, newIOContext(r)); } } return wrapDirectory(r, impl, rarely(r)); }
private void copyInMemoryLuceneIndexToDirectory(IndexCommit commit, Path directoryPath) throws IOException { Directory from = commit.getDirectory(); try (Directory to = new NIOFSDirectory(directoryPath)) { for (String filename : commit.getFileNames()) { to.copyFrom(from, filename, filename, IOContext.DEFAULT); } } }
@Override public void write(Directory dir, SegmentInfo si, IOContext context) throws IOException { String fileName = IndexFileNames.segmentFileName(si.name, "", COMPOUND_FILE_EXTENSION); try (Directory cfs = new Lucene40CompoundReader(dir, fileName, context, true)) { for (String file : si.files()) { cfs.copyFrom(dir, file, file, context); } } }
public static void copyDirectory( Directory source, Directory target ) throws IOException { //FIXME: check if this copies too much, Lucene 4 has no filter for lucene files //Directory.copy( source, target, false ); for ( String file : source.listAll() ) { target.copyFrom( source, file, file, IOContext.DEFAULT ); } copyFile( source, target, IndexingContext.INDEX_UPDATER_PROPERTIES_FILE ); copyFile( source, target, IndexingContext.INDEX_PACKER_PROPERTIES_FILE ); Date ts = getTimestamp( source ); updateTimestamp( target, ts ); }
public static void copyDirectory( Directory source, Directory target ) throws IOException { //FIXME: check if this copies too much, Lucene 4 has no filter for lucene files //Directory.copy( source, target, false ); for ( String file : source.listAll() ) { target.copyFrom( source, file, file, IOContext.DEFAULT ); } copyFile( source, target, IndexingContext.INDEX_UPDATER_PROPERTIES_FILE ); copyFile( source, target, IndexingContext.INDEX_PACKER_PROPERTIES_FILE ); Date ts = getTimestamp( source ); updateTimestamp( target, ts ); }
directory.copyFrom(info.info.dir, file, newFileName, context); copiedFiles.add(newFileName);