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

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

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

FileUtils.getContainerCapacity介绍

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

代码示例

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

@Override
public long getContainerCapacity(final String containerName) throws IOException {
  final Path path = containers.get(containerName);
  if (path == null) {
    throw new IllegalArgumentException("No container exists with name " + containerName);
  }
  long capacity = FileUtils.getContainerCapacity(path);
  if(capacity==0) {
    throw new IOException("System returned total space of the partition for " + containerName + " is zero byte. "
        + "Nifi can not create a zero sized FileSystemRepository.");
  }
  return capacity;
}

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

@Override
public long getContainerCapacity(final String containerName) throws IOException {
  Map<String, File> map = configuration.getStorageDirectories();
  File container = map.get(containerName);
  if(container != null) {
    long capacity = FileUtils.getContainerCapacity(container.toPath());
    if(capacity==0) {
      throw new IOException("System returned total space of the partition for " + containerName + " is zero byte. "
          + "Nifi can not create a zero sized provenance repository.");
    }
    return capacity;
  } else {
    throw new IllegalArgumentException("There is no defined container with name " + containerName);
  }
}

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

@Override
public long getContainerCapacity(final String containerName) throws IOException {
  Map<String, File> map = config.getStorageDirectories();
  File container = map.get(containerName);
  if(container != null) {
    long capacity = FileUtils.getContainerCapacity(container.toPath());
    if(capacity==0) {
      throw new IOException("System returned total space of the partition for " + containerName + " is zero byte. "
          + "Nifi can not create a zero sized provenance repository.");
    }
    return capacity;
  } else {
    throw new IllegalArgumentException("There is no defined container with name " + containerName);
  }
}

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

@Override
public long getContainerCapacity(String containerName) throws IOException {
  Map<String, File> map = configuration.getStorageDirectories();
  File container = map.get(containerName);
  if(container != null) {
    long capacity = FileUtils.getContainerCapacity(container.toPath());
    if(capacity==0) {
      throw new IOException("System returned total space of the partition for " + containerName + " is zero byte. "
          + "Nifi can not create a zero sized provenance repository.");
    }
    return capacity;
  } else {
    throw new IllegalArgumentException("There is no defined container with name " + containerName);
  }
}

相关文章