本文整理匯總了Java中org.apache.hadoop.security.alias.LocalJavaKeyStoreProvider類的典型用法代碼示例。如果您正苦於以下問題:Java LocalJavaKeyStoreProvider類的具體用法?Java LocalJavaKeyStoreProvider怎麽用?Java LocalJavaKeyStoreProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LocalJavaKeyStoreProvider類屬於org.apache.hadoop.security.alias包,在下文中一共展示了LocalJavaKeyStoreProvider類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: nestURIForLocalJavaKeyStoreProvider
import org.apache.hadoop.security.alias.LocalJavaKeyStoreProvider; //導入依賴的package包/類
/**
* Mangle given local java keystore file URI to allow use as a
* LocalJavaKeyStoreProvider.
* @param localFile absolute URI with file scheme and no authority component.
* i.e. return of File.toURI,
* e.g. file:///home/larry/creds.jceks
* @return URI of the form localjceks://file/home/larry/creds.jceks
* @throws IllegalArgumentException if localFile isn't not a file uri or if it
* has an authority component.
* @throws URISyntaxException if the wrapping process violates RFC 2396
*/
public static URI nestURIForLocalJavaKeyStoreProvider(final URI localFile)
throws URISyntaxException {
if (!("file".equals(localFile.getScheme()))) {
throw new IllegalArgumentException("passed URI had a scheme other than " +
"file.");
}
if (localFile.getAuthority() != null) {
throw new IllegalArgumentException("passed URI must not have an " +
"authority component. For non-local keystores, please use " +
JavaKeyStoreProvider.class.getName());
}
return new URI(LocalJavaKeyStoreProvider.SCHEME_NAME,
"//file" + localFile.getSchemeSpecificPart(), localFile.getFragment());
}