org.apache.hadoop.fs.Path.isUriPathAbsolute()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(149)

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

Path.isUriPathAbsolute介绍

[英]True if the path component (i.e. directory) of this URI is absolute.
[中]如果此URI的路径组件(即目录)是绝对的,则为True。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Returns true if the path component (i.e. directory) of this URI is
 * absolute.  This method is a wrapper for {@link #isUriPathAbsolute()}.
 *
 * @return whether this URI's path is absolute
 */
public boolean isAbsolute() {
  return isUriPathAbsolute();
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

Path fixRelativePart(Path p) {
 Preconditions.checkNotNull(p, "path cannot be null");
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(workingDir, p);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Returns true if the path component (i.e. directory) of this URI is
 * absolute <strong>and</strong> the scheme is null, <b>and</b> the authority
 * is null.
 *
 * @return whether the path is absolute and the URI has no scheme nor
 * authority parts
 */
public boolean isAbsoluteAndSchemeAuthorityNull() {
 return  (isUriPathAbsolute() && 
   uri.getScheme() == null && uri.getAuthority() == null);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Return a version of the given Path without the scheme information.
 *
 * @param path the source Path
 * @return a copy of this Path without the scheme information
 */
public static Path getPathWithoutSchemeAndAuthority(Path path) {
 // This code depends on Path.toString() to remove the leading slash before
 // the drive specification on Windows.
 Path newPath = path.isUriPathAbsolute() ?
  new Path(null, null, path.toUri().getPath()) :
  path;
 return newPath;
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * See {@link FileContext#fixRelativePart}.
 */
protected Path fixRelativePart(Path p) {
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(getWorkingDirectory(), p);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Test whether this Path uses a scheme and is relative.
 * Pathnames with scheme and relative path are illegal.
 */
void checkNotSchemeWithRelative() {
 if (toUri().isAbsolute() && !isUriPathAbsolute()) {
  throw new HadoopIllegalArgumentException(
    "Unsupported name: has scheme but relative path-part");
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

if (thatScheme == null) {
 if (thatAuthority == null) {
  if (path.isUriPathAbsolute()) {
   return;

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

for (String path : paths) {
 Path target = new Path(path);
 if (!target.isUriPathAbsolute()) {
  throw new IllegalArgumentException("The path " + target
    + " is not absolute");

代码示例来源:origin: io.hops/hadoop-common

/**
 * Returns true if the path component (i.e. directory) of this URI is
 * absolute.  This method is a wrapper for {@link #isUriPathAbsolute()}.
 *
 * @return whether this URI's path is absolute
 */
public boolean isAbsolute() {
  return isUriPathAbsolute();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * There is some ambiguity here. An absolute path is a slash
 * relative name without a scheme or an authority.
 * So either this method was incorrectly named or its
 * implementation is incorrect. This method returns true
 * even if there is a scheme and authority.
 */
public boolean isAbsolute() {
  return isUriPathAbsolute();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

Path fixRelativePart(Path p) {
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(workingDir, p);
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

Path fixRelativePart(Path p) {
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(workingDir, p);
 }
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Returns true if the path component (i.e. directory) of this URI is
 * absolute <strong>and</strong> the scheme is null, <b>and</b> the authority
 * is null.
 *
 * @return whether the path is absolute and the URI has no scheme nor
 * authority parts
 */
public boolean isAbsoluteAndSchemeAuthorityNull() {
 return  (isUriPathAbsolute() && 
   uri.getScheme() == null && uri.getAuthority() == null);
}

代码示例来源:origin: io.hops/hadoop-common

Path fixRelativePart(Path p) {
 Preconditions.checkNotNull(p, "path cannot be null");
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(workingDir, p);
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Is an absolute path (ie a slash relative path part)
 *  AND  a scheme is null AND  authority is null.
 */
public boolean isAbsoluteAndSchemeAuthorityNull() {
 return  (isUriPathAbsolute() && 
   uri.getScheme() == null && uri.getAuthority() == null);
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Test whether this Path uses a scheme and is relative.
 * Pathnames with scheme and relative path are illegal.
 */
void checkNotSchemeWithRelative() {
 if (toUri().isAbsolute() && !isUriPathAbsolute()) {
  throw new HadoopIllegalArgumentException(
    "Unsupported name: has scheme but relative path-part");
 }
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * See {@link FileContext#fixRelativePart}
 */
protected Path fixRelativePart(Path p) {
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(getWorkingDirectory(), p);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Pathnames with scheme and relative path are illegal.
 */
void checkNotSchemeWithRelative() {
 if (toUri().isAbsolute() && !isUriPathAbsolute()) {
  throw new HadoopIllegalArgumentException(
    "Unsupported name: has scheme but relative path-part");
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Pathnames with scheme and relative path are illegal.
 */
void checkNotSchemeWithRelative() {
 if (toUri().isAbsolute() && !isUriPathAbsolute()) {
  throw new HadoopIllegalArgumentException(
    "Unsupported name: has scheme but relative path-part");
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * See {@link FileContext#fixRelativePart}
 */
protected Path fixRelativePart(Path p) {
 if (p.isUriPathAbsolute()) {
  return p;
 } else {
  return new Path(getWorkingDirectory(), p);
 }
}

相关文章