本文整理了Java中org.apache.nifi.util.file.FileUtils.ensureDirectoryExistAndCanAccess()
方法的一些代码示例,展示了FileUtils.ensureDirectoryExistAndCanAccess()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.ensureDirectoryExistAndCanAccess()
方法的具体详情如下:
包路径:org.apache.nifi.util.file.FileUtils
类名称:FileUtils
方法名:ensureDirectoryExistAndCanAccess
暂无
代码示例来源:origin: apache/nifi
protected File getBootstrapFile(final Logger logger, String directory, String defaultDirectory, String fileName) throws IOException {
final File confDir = bootstrapConfigFile.getParentFile();
final File nifiHome = confDir.getParentFile();
String confFileDir = System.getProperty(directory);
final File fileDir;
if (confFileDir != null) {
fileDir = new File(confFileDir.trim());
} else {
fileDir = new File(nifiHome, defaultDirectory);
}
FileUtils.ensureDirectoryExistAndCanAccess(fileDir);
final File statusFile = new File(fileDir, fileName);
logger.debug("Status File: {}", statusFile);
return statusFile;
}
代码示例来源:origin: apache/nifi
private void syncWithRestoreDirectory() throws IOException {
// sanity check that restore directory is a directory, creating it if necessary
FileUtils.ensureDirectoryExistAndCanAccess(restoreDirectory);
// check that restore directory is not the same as the primary directory
if (config.getParentFile().getAbsolutePath().equals(restoreDirectory.getAbsolutePath())) {
throw new IllegalStateException(
String.format("Cluster firewall configuration file '%s' cannot be in the restore directory '%s' ",
config.getAbsolutePath(), restoreDirectory.getAbsolutePath()));
}
// the restore copy will have same file name, but reside in a different directory
final File restoreFile = new File(restoreDirectory, config.getName());
// sync the primary copy with the restore copy
FileUtils.syncWithRestore(config, restoreFile, logger);
}
代码示例来源:origin: apache/nifi
if (restoreDirectory != null) {
FileUtils.ensureDirectoryExistAndCanAccess(restoreDirectory);
代码示例来源:origin: apache/nifi
if (restoreDirectory != null) {
FileUtils.ensureDirectoryExistAndCanAccess(restoreDirectory);
代码示例来源:origin: apache/nifi-minifi
private File getBootstrapFile(final Logger logger, String directory, String defaultDirectory, String fileName) throws IOException {
final File confDir = bootstrapConfigFile.getParentFile();
final File nifiHome = confDir.getParentFile();
String confFileDir = System.getProperty(directory);
final File fileDir;
if (confFileDir != null) {
fileDir = new File(confFileDir.trim());
} else {
fileDir = new File(nifiHome, defaultDirectory);
}
FileUtils.ensureDirectoryExistAndCanAccess(fileDir);
final File statusFile = new File(fileDir, fileName);
logger.debug("Status File: {}", statusFile);
return statusFile;
}
内容来源于网络,如有侵权,请联系作者删除!