public final class S3xLoginHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
S3xLoginHelper.Login
Simple tuple of login details.
|
Modifier and Type | Field and Description |
---|---|
static String |
LOGIN_WARNING |
static String |
PLUS_ENCODED |
static String |
PLUS_UNENCODED |
static String |
PLUS_WARNING |
Modifier and Type | Method and Description |
---|---|
static URI |
buildFSURI(URI uri)
Build the filesystem URI.
|
static URI |
canonicalizeUri(URI uri,
int defaultPort)
Canonicalize the given URI.
|
static void |
checkPath(org.apache.hadoop.conf.Configuration conf,
URI fsUri,
org.apache.hadoop.fs.Path path,
int defaultPort)
Check the path, ignoring authentication details.
|
static S3xLoginHelper.Login |
extractLoginDetails(URI name)
Extract the login details from a URI.
|
static S3xLoginHelper.Login |
extractLoginDetailsWithWarnings(URI name)
Extract the login details from a URI, logging a warning if
the URI contains these.
|
static String |
toString(URI pathUri)
Create a stripped down string value for error messages.
|
public static final String LOGIN_WARNING
public static final String PLUS_WARNING
public static final String PLUS_UNENCODED
public static final String PLUS_ENCODED
public static URI buildFSURI(URI uri)
uri
- filesystem uriIllegalArgumentException
- if the URI is in some way invalid.public static String toString(URI pathUri)
pathUri
- URIpublic static S3xLoginHelper.Login extractLoginDetailsWithWarnings(URI name)
name
- URI of the filesystempublic static S3xLoginHelper.Login extractLoginDetails(URI name)
name
- URI of the filesystempublic static URI canonicalizeUri(URI uri, int defaultPort)
uri
- the URI to canonicalizedefaultPort
- default port to use in canonicalized URI if the input
URI has no port and this value is greater than 0public static void checkPath(org.apache.hadoop.conf.Configuration conf, URI fsUri, org.apache.hadoop.fs.Path path, int defaultPort)
FileSystem.checkPath(Path)
for the operation of this.
Essentially
URI.getHost()
over URI.getAuthority()
. Some of that
code looks a relic of the code anti-pattern of using "hdfs:file.txt"
to define the path without declaring the hostname. It's retained
for compatibility.conf
- FS configurationfsUri
- the FS URIpath
- path to checkdefaultPort
- default port of FSCopyright © 2018 Apache Software Foundation. All Rights Reserved.