本文整理汇总了Java中org.apache.hadoop.fs.Path.isUriPathAbsolute方法的典型用法代码示例。如果您正苦于以下问题:Java Path.isUriPathAbsolute方法的具体用法?Java Path.isUriPathAbsolute怎么用?Java Path.isUriPathAbsolute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.fs.Path
的用法示例。
在下文中一共展示了Path.isUriPathAbsolute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isACLsFileNewer
import org.apache.hadoop.fs.Path; //导入方法依赖的package包/类
public static boolean isACLsFileNewer(long time) {
boolean newer = false;
String confDir = System.getProperty(KMS_CONFIG_DIR);
if (confDir != null) {
Path confPath = new Path(confDir);
if (!confPath.isUriPathAbsolute()) {
throw new RuntimeException("System property '" + KMS_CONFIG_DIR +
"' must be an absolute path: " + confDir);
}
File f = new File(confDir, KMS_ACLS_XML);
// at least 100ms newer than time, we do this to ensure the file
// has been properly closed/flushed
newer = f.lastModified() - time > 100;
}
return newer;
}
示例2: getResolvedPath
import org.apache.hadoop.fs.Path; //导入方法依赖的package包/类
/**
* Return a path with the link resolved with the target.
*/
public Path getResolvedPath() throws IOException {
// If the path is absolute we cam throw out the preceding part and
// just append the remainder to the target, otherwise append each
// piece to resolve the link in path.
boolean noRemainder = (remainder == null || "".equals(remainder));
Path target = new Path(linkTarget);
if (target.isUriPathAbsolute()) {
return noRemainder ? target : new Path(target, remainder);
} else {
return noRemainder
? new Path(preceding, target)
: new Path(new Path(preceding, linkTarget), remainder);
}
}