/** * 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(); }
Path fixRelativePart(Path p) { Preconditions.checkNotNull(p, "path cannot be null"); if (p.isUriPathAbsolute()) { return p; } else { return new Path(workingDir, p); } }
/** * 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); }
/** * 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; }
/** * See {@link FileContext#fixRelativePart}. */ protected Path fixRelativePart(Path p) { if (p.isUriPathAbsolute()) { return p; } else { return new Path(getWorkingDirectory(), p); } }
/** * 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"); } }
if (thatScheme == null) { if (thatAuthority == null) { if (path.isUriPathAbsolute()) { return;
for (String path : paths) { Path target = new Path(path); if (!target.isUriPathAbsolute()) { throw new IllegalArgumentException("The path " + target + " is not absolute");
/** * 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(); }
/** * 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(); }
Path fixRelativePart(Path p) { if (p.isUriPathAbsolute()) { return p; } else { return new Path(workingDir, p); } }
Path fixRelativePart(Path p) { if (p.isUriPathAbsolute()) { return p; } else { return new Path(workingDir, p); } }
/** * 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); }
Path fixRelativePart(Path p) { Preconditions.checkNotNull(p, "path cannot be null"); if (p.isUriPathAbsolute()) { return p; } else { return new Path(workingDir, p); } }
/** * 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); }
/** * 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"); } }
/** * See {@link FileContext#fixRelativePart} */ protected Path fixRelativePart(Path p) { if (p.isUriPathAbsolute()) { return p; } else { return new Path(getWorkingDirectory(), p); } }
/** * 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"); } }
/** * 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"); } }
/** * See {@link FileContext#fixRelativePart} */ protected Path fixRelativePart(Path p) { if (p.isUriPathAbsolute()) { return p; } else { return new Path(getWorkingDirectory(), p); } }