当前位置: 首页>>代码示例>>Java>>正文


Java ProviderUtils.unnestUri方法代码示例

本文整理汇总了Java中org.apache.hadoop.security.ProviderUtils.unnestUri方法的典型用法代码示例。如果您正苦于以下问题:Java ProviderUtils.unnestUri方法的具体用法?Java ProviderUtils.unnestUri怎么用?Java ProviderUtils.unnestUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.security.ProviderUtils的用法示例。


在下文中一共展示了ProviderUtils.unnestUri方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testJksProvider

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
@Test
public void testJksProvider() throws Exception {
  Configuration conf = new Configuration();
  final Path jksPath = new Path(tmpDir.toString(), "test.jks");
  final String ourUrl =
      JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();

  File file = new File(tmpDir, "test.jks");
  file.delete();
  conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl);
  checkSpecificProvider(conf, ourUrl);
  Path path = ProviderUtils.unnestUri(new URI(ourUrl));
  FileSystem fs = path.getFileSystem(conf);
  FileStatus s = fs.getFileStatus(path);
  assertTrue(s.getPermission().toString().equals("rwx------"));
  assertTrue(file + " should exist", file.isFile());

  // check permission retention after explicit change
  fs.setPermission(path, new FsPermission("777"));
  checkPermissionRetention(conf, ourUrl, path);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:22,代码来源:TestCredentialProviderFactory.java

示例2: testLocalJksProvider

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
@Test
public void testLocalJksProvider() throws Exception {
  Configuration conf = new Configuration();
  final Path jksPath = new Path(tmpDir.toString(), "test.jks");
  final String ourUrl =
      LocalJavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();

  File file = new File(tmpDir, "test.jks");
  file.delete();
  conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl);
  checkSpecificProvider(conf, ourUrl);
  Path path = ProviderUtils.unnestUri(new URI(ourUrl));
  FileSystem fs = path.getFileSystem(conf);
  FileStatus s = fs.getFileStatus(path);
  assertTrue("Unexpected permissions: " + s.getPermission().toString(), s.getPermission().toString().equals("rwx------"));
  assertTrue(file + " should exist", file.isFile());

  // check permission retention after explicit change
  fs.setPermission(path, new FsPermission("777"));
  checkPermissionRetention(conf, ourUrl, path);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:22,代码来源:TestCredentialProviderFactory.java

示例3: testJksProvider

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
@Test
public void testJksProvider() throws Exception {
  Configuration conf = new Configuration();
  final Path jksPath = new Path(tmpDir.toString(), "test.jks");
  final String ourUrl =
      JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();

  File file = new File(tmpDir, "test.jks");
  file.delete();
  conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl);
  checkSpecificProvider(conf, ourUrl);
  Path path = ProviderUtils.unnestUri(new URI(ourUrl));
  FileSystem fs = path.getFileSystem(conf);
  FileStatus s = fs.getFileStatus(path);
  assertTrue(s.getPermission().toString().equals("rw-------"));
  assertTrue(file + " should exist", file.isFile());

  // check permission retention after explicit change
  fs.setPermission(path, new FsPermission("777"));
  checkPermissionRetention(conf, ourUrl, path);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:22,代码来源:TestCredentialProviderFactory.java

示例4: testLocalJksProvider

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
@Test
public void testLocalJksProvider() throws Exception {
  Configuration conf = new Configuration();
  final Path jksPath = new Path(tmpDir.toString(), "test.jks");
  final String ourUrl =
      LocalJavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();

  File file = new File(tmpDir, "test.jks");
  file.delete();
  conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl);
  checkSpecificProvider(conf, ourUrl);
  Path path = ProviderUtils.unnestUri(new URI(ourUrl));
  FileSystem fs = path.getFileSystem(conf);
  FileStatus s = fs.getFileStatus(path);
  assertTrue("Unexpected permissions: " + s.getPermission().toString(),
      s.getPermission().toString().equals("rw-------"));
  assertTrue(file + " should exist", file.isFile());

  // check permission retention after explicit change
  fs.setPermission(path, new FsPermission("777"));
  checkPermissionRetention(conf, ourUrl, path);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:23,代码来源:TestCredentialProviderFactory.java

示例5: initFileSystem

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
protected void initFileSystem(URI keystoreUri, Configuration conf)
    throws IOException {
  path = ProviderUtils.unnestUri(keystoreUri);
  if (LOG.isDebugEnabled()) {
    LOG.debug("backing jks path initialized to " + path);
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:8,代码来源:AbstractJavaKeyStoreProvider.java

示例6: initFileSystem

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
protected void initFileSystem(URI keystoreUri)
    throws IOException {
  path = ProviderUtils.unnestUri(keystoreUri);
  if (LOG.isDebugEnabled()) {
    LOG.debug("backing jks path initialized to " + path);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:8,代码来源:AbstractJavaKeyStoreProvider.java

示例7: JavaKeyStoreProvider

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
private JavaKeyStoreProvider(URI uri, Configuration conf) throws IOException {
  super(conf);
  this.uri = uri;
  path = ProviderUtils.unnestUri(uri);
  fs = path.getFileSystem(conf);
  locateKeystore();
  ReadWriteLock lock = new ReentrantReadWriteLock(true);
  readLock = lock.readLock();
  writeLock = lock.writeLock();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:11,代码来源:JavaKeyStoreProvider.java

示例8: extractKMSPath

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
private static Path extractKMSPath(URI uri) throws MalformedURLException, IOException {
  return ProviderUtils.unnestUri(uri);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:4,代码来源:KMSClientProvider.java

示例9: initFileSystem

import org.apache.hadoop.security.ProviderUtils; //导入方法依赖的package包/类
protected void initFileSystem(URI keystoreUri, Configuration conf)
    throws IOException {
  path = ProviderUtils.unnestUri(keystoreUri);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:AbstractJavaKeyStoreProvider.java


注:本文中的org.apache.hadoop.security.ProviderUtils.unnestUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。