org.apache.cassandra.io.util.FileUtils.getFileStore()方法的使用及代码示例

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

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

FileUtils.getFileStore介绍

[英]Returns the FileStore representing the file store where a file is located. This FileStore handles large file system by returning Long.MAX_VALUEfrom FileStore#getTotalSpace(), FileStore#getUnallocatedSpace() and FileStore#getUsableSpace()it the value is bigger than Long.MAX_VALUE. See JDK-8162520 for more information.
[中]返回表示文件所在的文件存储的文件存储。此文件存储通过返回Long来处理大型文件系统。如果该值大于Long,则来自FileStore#getTotalSpace()、FileStore#getUnallocatedSpace()和FileStore#getUsableSpace()的最大值。最大值。有关详细信息,请参见JDK-8162520

代码示例

代码示例来源:origin: org.apache.cassandra/cassandra-all

private static FileStore guessFileStore(String dir) throws IOException
{
  Path path = Paths.get(dir);
  while (true)
  {
    try
    {
      return FileUtils.getFileStore(path);
    }
    catch (IOException e)
    {
      if (e instanceof NoSuchFileException)
        path = path.getParent();
      else
        throw e;
    }
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

private static FileStore guessFileStore(String dir) throws IOException
{
  Path path = Paths.get(dir);
  while (true)
  {
    try
    {
      return FileUtils.getFileStore(path);
    }
    catch (IOException e)
    {
      if (e instanceof NoSuchFileException)
        path = path.getParent();
      else
        throw e;
    }
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

private static FileStore guessFileStore(String dir) throws IOException
{
  Path path = Paths.get(dir);
  while (true)
  {
    try
    {
      return FileUtils.getFileStore(path);
    }
    catch (IOException e)
    {
      if (e instanceof NoSuchFileException)
        path = path.getParent();
      else
        throw e;
    }
  }
}

相关文章