org.apache.nifi.util.file.FileUtils.getContainerUsableSpace()方法的使用及代码示例

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

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

FileUtils.getContainerUsableSpace介绍

[英]Returns the free capacity for a given path
[中]返回给定路径的可用容量

代码示例

代码示例来源:origin: apache/nifi

@Override
public long getContainerUsableSpace(String containerName) throws IOException {
  final Path path = containers.get(containerName);
  if (path == null) {
    throw new IllegalArgumentException("No container exists with name " + containerName);
  }
  return FileUtils.getContainerUsableSpace(path);
}

代码示例来源:origin: apache/nifi

@Override
  public long getContainerUsableSpace(String containerName) throws IOException {
    Map<String, File> map = config.getStorageDirectories();

    File container = map.get(containerName);
    if(container != null) {
      return FileUtils.getContainerUsableSpace(container.toPath());
    } else {
      throw new IllegalArgumentException("There is no defined container with name " + containerName);
    }
  }
}

代码示例来源:origin: apache/nifi

@Override
public long getContainerUsableSpace(String containerName) throws IOException {
  Map<String, File> map = configuration.getStorageDirectories();
  File container = map.get(containerName);
  if(container != null) {
    return FileUtils.getContainerUsableSpace(container.toPath());
  } else {
    throw new IllegalArgumentException("There is no defined container with name " + containerName);
  }
}

代码示例来源:origin: apache/nifi-minifi

@Override
public long getContainerUsableSpace(String containerName) throws IOException {
  Map<String, File> map = configuration.getStorageDirectories();
  File container = map.get(containerName);
  if(container != null) {
    return FileUtils.getContainerUsableSpace(container.toPath());
  } else {
    throw new IllegalArgumentException("There is no defined container with name " + containerName);
  }
}

相关文章