org.neo4j.io.fs.FileUtils.moveFileToDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(194)

本文整理了Java中org.neo4j.io.fs.FileUtils.moveFileToDirectory()方法的一些代码示例,展示了FileUtils.moveFileToDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.moveFileToDirectory()方法的具体详情如下:
包路径:org.neo4j.io.fs.FileUtils
类名称:FileUtils
方法名:moveFileToDirectory

FileUtils.moveFileToDirectory介绍

[英]Utility method that moves a file from its current location to the provided target directory. If rename fails (for example if the target is another disk) a copy/delete will be performed instead. This is not a rename, use #renameFile(File,File,CopyOption...) instead.
[中]将文件从当前位置移动到提供的目标目录的实用方法。如果重命名失败(例如,如果目标是另一个磁盘),将执行复制/删除。这不是重命名,请使用#重命名文件(文件、文件、复制选项…)相反

代码示例

代码示例来源:origin: neo4j/neo4j

@Override
public void moveToDirectory( File file, File toDirectory ) throws IOException
{
  FileUtils.moveFileToDirectory( file, toDirectory );
}

代码示例来源:origin: neo4j/neo4j

@Test
public void moveFileToDirectory() throws Exception
{
  File file = touchFile( "source" );
  File targetDir = directory( "dir" );
  File newLocationOfFile = FileUtils.moveFileToDirectory( file, targetDir );
  assertTrue( newLocationOfFile.exists() );
  assertFalse( file.exists() );
  assertEquals( newLocationOfFile, targetDir.listFiles()[0] );
}

代码示例来源:origin: org.neo4j/neo4j-io

@Override
public void moveToDirectory( File file, File toDirectory ) throws IOException
{
  FileUtils.moveFileToDirectory( file, toDirectory );
}

代码示例来源:origin: org.neo4j/neo4j-com

public static void moveAwayDb( File storeDir, File branchedDataDir, PageCache pageCache ) throws IOException
{
  for ( File file : relevantDbFiles( storeDir ) )
  {
    FileUtils.moveFileToDirectory( file, branchedDataDir );
  }
  moveAwayDbWithPageCache( storeDir, branchedDataDir, pageCache, DEEP_STORE_FILE_FILTER );
}

相关文章