本文整理了Java中org.neo4j.io.fs.FileUtils.copyRecursively()
方法的一些代码示例,展示了FileUtils.copyRecursively()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.copyRecursively()
方法的具体详情如下:
包路径:org.neo4j.io.fs.FileUtils
类名称:FileUtils
方法名:copyRecursively
暂无
代码示例来源:origin: neo4j/neo4j
@Override
public void copyRecursively( File fromDirectory, File toDirectory ) throws IOException
{
FileUtils.copyRecursively( fromDirectory, toDirectory );
}
代码示例来源:origin: neo4j/neo4j
public static void copyRecursively( File fromDirectory, File toDirectory ) throws IOException
{
copyRecursively( fromDirectory, toDirectory, null );
}
代码示例来源:origin: neo4j/neo4j
private void copyDatabase( File from, Config config ) throws IOException
{
FileUtils.copyRecursively( from, config.get( database_path ) );
}
代码示例来源:origin: neo4j/neo4j
public static void copyRecursively( File fromDirectory, File toDirectory, FileFilter filter ) throws IOException
{
File[] files = fromDirectory.listFiles( filter );
if ( files != null )
{
for ( File fromFile : files )
{
File toFile = new File( toDirectory, fromFile.getName() );
if ( fromFile.isDirectory() )
{
Files.createDirectories( toFile.toPath() );
copyRecursively( fromFile, toFile, filter );
}
else
{
copyFile( fromFile, toFile );
}
}
}
}
代码示例来源:origin: neo4j/neo4j
copyRecursively( toMove, target );
deleteRecursively( toMove );
代码示例来源:origin: neo4j/neo4j
private static File snapshot( final File path ) throws IOException
{
File snapshotDir = new File( path, "snapshot-" + new Random().nextInt() );
FileUtils.copyRecursively( path, snapshotDir, pathName ->
{
String subPath = pathName.getAbsolutePath().substring( path.getPath().length() + 1 );
// since the db is running, exclude the lock files
return !"store_lock".equals( subPath ) && !subPath.endsWith( "write.lock" );
} );
return snapshotDir;
}
代码示例来源:origin: neo4j/neo4j
@Test
public void reportNotCleanNativeIndexWithCorrectData() throws IOException, ConsistencyCheckIncompleteException
{
DatabaseLayout databaseLayout = db.databaseLayout();
someData();
resolveComponent( CheckPointer.class ).forceCheckPoint( new SimpleTriggerInfo( "forcedCheckpoint" ) );
File indexesCopy = databaseLayout.file( "indexesCopy" );
File indexSources = resolveComponent( DefaultIndexProviderMap.class ).getDefaultProvider().directoryStructure().rootDirectory();
copyRecursively( indexSources, indexesCopy, SOURCE_COPY_FILE_FILTER );
db.shutdownAndKeepStore();
copyRecursively( indexesCopy, indexSources );
ConsistencyCheckService.Result result = fullConsistencyCheck();
assertTrue( "Expected consistency check to fail", result.isSuccessful() );
assertThat( readReport( result ),
hasItem( containsString("WARN : Index was not properly shutdown and rebuild is required.") ) );
}
代码示例来源:origin: neo4j/neo4j
@Test
public void reportNotCleanNativeIndex() throws IOException, ConsistencyCheckIncompleteException
{
DatabaseLayout databaseLayout = db.databaseLayout();
someData();
resolveComponent( CheckPointer.class ).forceCheckPoint( new SimpleTriggerInfo( "forcedCheckpoint" ) );
File indexesCopy = databaseLayout.file( "indexesCopy" );
File indexSources = resolveComponent( DefaultIndexProviderMap.class ).getDefaultProvider().directoryStructure().rootDirectory();
copyRecursively( indexSources, indexesCopy, SOURCE_COPY_FILE_FILTER );
try ( Transaction tx = db.beginTx() )
{
createNewNode( new Label[]{LABEL_ONE} );
tx.success();
}
db.shutdownAndKeepStore();
copyRecursively( indexesCopy, indexSources );
ConsistencyCheckService.Result result = fullConsistencyCheck();
assertFalse( "Expected consistency check to fail", result.isSuccessful() );
assertThat( readReport( result ),
hasItem( containsString("WARN : Index was not properly shutdown and rebuild is required.") ) );
}
代码示例来源:origin: org.neo4j/neo4j-io
@Override
public void copyRecursively( File fromDirectory, File toDirectory ) throws IOException
{
FileUtils.copyRecursively( fromDirectory, toDirectory );
}
代码示例来源:origin: org.neo4j/neo4j-io
public static void copyRecursively( File fromDirectory, File toDirectory ) throws IOException
{
copyRecursively( fromDirectory, toDirectory, null );
}
代码示例来源:origin: jexp/store-utils
private static void copyIndex(File source, File target) throws IOException {
final File indexFile = new File(source, "index.db");
if (indexFile.exists()) {
FileUtils.copyFile(indexFile, new File(target, "index.db"));
}
final File indexDir = new File(source, "index");
if (indexDir.exists()) {
FileUtils.copyRecursively(indexDir, new File(target, "index"));
}
}
代码示例来源:origin: jexp/store-utils
private static void copyIndex(File source, File target) throws IOException {
final File indexFile = new File(source, "index.db");
if (indexFile.exists()) {
FileUtils.copyFile(indexFile, new File(target, "index.db"));
}
final File indexDir = new File(source, "index");
if (indexDir.exists()) {
FileUtils.copyRecursively(indexDir, new File(target, "index"));
}
}
代码示例来源:origin: org.neo4j/neo4j-dbms
private void copyDatabase( File from, Config config ) throws IOException
{
FileUtils.copyRecursively( from, config.get( database_path ) );
}
代码示例来源:origin: org.neo4j/neo4j-io
public static void copyRecursively( File fromDirectory, File toDirectory, FileFilter filter ) throws IOException
{
File[] files = fromDirectory.listFiles( filter );
if ( files != null )
{
for ( File fromFile : files )
{
File toFile = new File( toDirectory, fromFile.getName() );
if ( fromFile.isDirectory() )
{
Files.createDirectories( toFile.toPath() );
copyRecursively( fromFile, toFile, filter );
}
else
{
copyFile( fromFile, toFile );
}
}
}
}
代码示例来源:origin: org.neo4j/neo4j-io
copyRecursively( toMove, target );
deleteRecursively( toMove );
内容来源于网络,如有侵权,请联系作者删除!