@Test(expected = IllegalArgumentException.class) public void testRejectsUnsupportedScheme() throws Exception { path("/any"); setAcls("/any", "unsupported:anyone:r"); }
private static void setAcls(String connectionString, String znode, ZkAcl acl) throws IOException, InterruptedException, KeeperException { ZooKeeper client = ZkConnection.open(connectionString, SESSION_TIMEOUT_MILLIS, CONNECTION_TIMEOUT_MILLIS); try { acl.setRecursivelyOn(client, ZkPathPattern.fromString(znode)); } catch (KeeperException.NoNodeException e) { System.out.println("Could not set ACL on " + znode + ". Reason: " + e.getMessage()); } finally { client.close(); } }
ZkMigrator { private static void setAcls(String connectionString, String znode, ZkAcl acl) throws IOException, InterruptedException, KeeperException { ZooKeeper client = ZkConnection.open(connectionString, SESSION_TIMEOUT_MILLIS, CONNECTION_TIMEOUT_MILLIS); try { acl.setRecursivelyOn(client, ZkPathPattern.fromString(znode)); } catch (KeeperException.NoNodeException e) { System.out.println("Could not set ACL on " + znode + ". Reason: " + e.getMessage()); } finally { client.close(); } } }
ZkMigrator { private static void setAcls(String connectionString, String znode, ZkAcl acl) throws IOException, InterruptedException, KeeperException { ZooKeeper client = ZkConnection.open(connectionString, SESSION_TIMEOUT_MILLIS, CONNECTION_TIMEOUT_MILLIS); try { acl.setRecursivelyOn(client, ZkPathPattern.fromString(znode)); } catch (KeeperException.NoNodeException e) { System.out.println("Could not set ACL on " + znode + ". Reason: " + e.getMessage()); } finally { client.close(); } }  }
ZkMigrator { private static void setAcls(String connectionString, String znode, ZkAcl acl) throws IOException, InterruptedException, KeeperException { ZooKeeper client = ZkConnection.open(connectionString, SESSION_TIMEOUT_MILLIS, CONNECTION_TIMEOUT_MILLIS); try { acl.setRecursivelyOn(client, ZkPathPattern.fromString(znode)); } catch (KeeperException.NoNodeException e) { System.out.println("Could not set ACL on " + znode + ". Reason: " + e.getMessage()); } finally { client.close(); } }  static void main(String[] args); }
ZkMigrator { private static void setAcls(String connectionString, String znode, ZkAcl acl) throws IOException, InterruptedException, KeeperException { ZooKeeper client = ZkConnection.open(connectionString, SESSION_TIMEOUT_MILLIS, CONNECTION_TIMEOUT_MILLIS); try { acl.setRecursivelyOn(client, ZkPathPattern.fromString(znode)); } catch (KeeperException.NoNodeException e) { System.out.println("Could not set ACL on " + znode + ". Reason: " + e.getMessage()); } finally { client.close(); } }  static void main(String[] args);  }