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

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

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

FileUtils.relativePath介绍

[英]Given a directory and a path under it, return filename of the path relative to the directory.
[中]给定一个目录及其下的路径,返回相对于该目录的路径的文件名。

代码示例

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

private void doWrite( StoreWriter writer, ByteBuffer temporaryBuffer, File file, int recordSize,
      ReadableByteChannel fileChannel, long fileSize, String storeCopyIdentifier, boolean isLogFile ) throws IOException
  {
    monitor.startStreamingStoreFile( file, storeCopyIdentifier );
    String path = isLogFile ? file.getName() : relativePath( storeDirectory, file );
    writer.write( path, fileChannel, temporaryBuffer, fileSize > 0, recordSize );
    monitor.finishStreamingStoreFile( file, storeCopyIdentifier );
  }
}

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

private StoreResource toStoreResource( StoreFileMetadata storeFileMetadata ) throws IOException
{
  File storeDir = neoStoreDataSource.getStoreDir();
  File file = storeFileMetadata.file();
  String relativePath = relativePath( storeDir, file );
  return new StoreResource( file, relativePath, storeFileMetadata.recordSize(), pageCache, fileSystemAbstraction );
}

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

@Override
public boolean next() throws IOException
{
  if ( !files.hasNext() )
  {
    resource = null;
    return false;
  }
  StoreFileMetadata md = files.next();
  resource = new StoreResource( md.file(), relativePath( storeDir, md.file() ), md.recordSize(), pageCache, fs );
  return true;
}

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

new StoreResource( storeFileMetadata.file(), relativePath( storeDir, storeFileMetadata.file() ), storeFileMetadata.recordSize(),
    pageCache, fs ) );

相关文章