當前位置: 首頁>>代碼示例>>Java>>正文


Java Path.isUriPathAbsolute方法代碼示例

本文整理匯總了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;
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:17,代碼來源:KMSConfiguration.java

示例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);
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:18,代碼來源:UnresolvedPathException.java


注:本文中的org.apache.hadoop.fs.Path.isUriPathAbsolute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。