public final class ProviderUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NO_PASSWORD_CONT |
static String |
NO_PASSWORD_ERROR |
static String |
NO_PASSWORD_INSTRUCTIONS_DOC |
static String |
NO_PASSWORD_WARN |
Modifier and Type | Method and Description |
---|---|
static Configuration |
excludeIncompatibleCredentialProviders(Configuration config,
Class<? extends FileSystem> fileSystemClass)
There are certain integrations of the credential provider API in
which a recursive dependency between the provider and the hadoop
filesystem abstraction causes a problem.
|
static char[] |
locatePassword(String envWithPass,
String fileWithPass)
The password is either found in the environment or in a file.
|
static URI |
nestURIForLocalJavaKeyStoreProvider(URI localFile)
Mangle given local java keystore file URI to allow use as a
LocalJavaKeyStoreProvider.
|
static String |
noPasswordError(String envKey,
String fileKey) |
static String |
noPasswordWarning(String envKey,
String fileKey) |
static Path |
unnestUri(URI nestedUri)
Convert a nested URI to decode the underlying path.
|
public static final String NO_PASSWORD_WARN
public static final String NO_PASSWORD_ERROR
public static final String NO_PASSWORD_CONT
public static final String NO_PASSWORD_INSTRUCTIONS_DOC
public static Path unnestUri(URI nestedUri)
nestedUri
- the URI from the nested URIpublic static URI nestURIForLocalJavaKeyStoreProvider(URI localFile) throws URISyntaxException
localFile
- absolute URI with file scheme and no authority component.
i.e. return of File.toURI,
e.g. file:///home/larry/creds.jceksIllegalArgumentException
- if localFile isn't not a file uri or if it
has an authority component.URISyntaxException
- if the wrapping process violates RFC 2396public static Configuration excludeIncompatibleCredentialProviders(Configuration config, Class<? extends FileSystem> fileSystemClass) throws IOException
config
- the existing configuration with provider pathfileSystemClass
- the class which providers must be compatibleIOException
public static char[] locatePassword(String envWithPass, String fileWithPass) throws IOException
envWithPass
- The name of the environment variable that might
contain the password. Must not be null.fileWithPass
- The name of a file that could contain the password.
Can be null.IOException
- If fileWithPass is non-null and points to a
nonexistent file or a file that fails to open and be read properly.Copyright © 2017 Apache Software Foundation. All Rights Reserved.