org.apache.hadoop.fs.Path#isWindowsAbsolutePath ( )源码实例Demo

下面列出了org.apache.hadoop.fs.Path#isWindowsAbsolutePath ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hadoop   文件: PathData.java
private static String uriToString(URI uri, boolean inferredSchemeFromPath) {
  String scheme = uri.getScheme();
  // No interpretation of symbols. Just decode % escaped chars.
  String decodedRemainder = uri.getSchemeSpecificPart();

  // Drop the scheme if it was inferred to ensure fidelity between
  // the input and output path strings.
  if ((scheme == null) || (inferredSchemeFromPath)) {
    if (Path.isWindowsAbsolutePath(decodedRemainder, true)) {
      // Strip the leading '/' added in stringToUri so users see a valid
      // Windows path.
      decodedRemainder = decodedRemainder.substring(1);
    }
    return decodedRemainder;
  } else {
    StringBuilder buffer = new StringBuilder();
    buffer.append(scheme);
    buffer.append(":");
    buffer.append(decodedRemainder);
    return buffer.toString();
  }
}
 
源代码2 项目: big-c   文件: PathData.java
private static String uriToString(URI uri, boolean inferredSchemeFromPath) {
  String scheme = uri.getScheme();
  // No interpretation of symbols. Just decode % escaped chars.
  String decodedRemainder = uri.getSchemeSpecificPart();

  // Drop the scheme if it was inferred to ensure fidelity between
  // the input and output path strings.
  if ((scheme == null) || (inferredSchemeFromPath)) {
    if (Path.isWindowsAbsolutePath(decodedRemainder, true)) {
      // Strip the leading '/' added in stringToUri so users see a valid
      // Windows path.
      decodedRemainder = decodedRemainder.substring(1);
    }
    return decodedRemainder;
  } else {
    StringBuilder buffer = new StringBuilder();
    buffer.append(scheme);
    buffer.append(":");
    buffer.append(decodedRemainder);
    return buffer.toString();
  }
}