List of usage examples for org.apache.hadoop.security ProviderUtils unnestUri
public static Path unnestUri(URI nestedUri)
From source file:org.apache.ranger.biz.KmsKeyMgr.java
License:Apache License
private static Path extractKMSPath(URI uri) throws MalformedURLException, IOException { return ProviderUtils.unnestUri(uri); }
From source file:uk.gov.gchq.gaffer.slider.util.SliderKeystoreUtils.java
License:Apache License
public static void ensureCredentialKeyStoresAbsent(final ConfTree appConfig) throws IOException, URISyntaxException { Set<String> keystores = getCredentialKeyStoreLocations(appConfig); FileSystem fs = CommandTestBase.getClusterFS(); for (final String keystore : keystores) { // Convert from jceks URL Path keystorePath = ProviderUtils.unnestUri(new URI(keystore)); if (fs.exists(keystorePath)) { throw new IOException("Credential keystore already exists: " + keystorePath); }/* w w w.ja va2 s. c o m*/ } }
From source file:uk.gov.gchq.gaffer.slider.util.SliderKeystoreUtils.java
License:Apache License
public static void deleteCredentialKeyStores(final ConfTree appConfig) throws IOException, URISyntaxException { Set<String> keystores = getCredentialKeyStoreLocations(appConfig); FileSystem fs = CommandTestBase.getClusterFS(); for (final String keystore : keystores) { // Convert from jceks URL Path keystorePath = ProviderUtils.unnestUri(new URI(keystore)); if (fs.exists(keystorePath)) { if (!fs.delete(keystorePath, false)) { throw new IOException("Unable to delete credential keystore: " + keystorePath); }//from w w w . ja va2 s .co m } } }