@Test public void testMove() throws Exception { assertEquals(Paths.get("/c/d"), Capsule.move(Paths.get("/a/b"), Paths.get("/a/b"), Paths.get("/c/d/"))); assertEquals(Paths.get("/c/d/e"), Capsule.move(Paths.get("/a/b/e"), Paths.get("/a/b"), Paths.get("/c/d/"))); }
protected static Path move(Path what, Path fromDir, Path toDir) { if (!what.startsWith(fromDir)) throw new IllegalArgumentException(what + " is not under " + fromDir); return toDir.resolve(fromDir.relativize(what)); }
Capsule implements Runnable, InvocationHandler { protected static Path move(Path what, Path fromDir, Path toDir) { if (!what.startsWith(fromDir)) throw new IllegalArgumentException(what + " is not under " + fromDir); return toDir.resolve(fromDir.relativize(what)); } }
Capsule implements Runnable, InvocationHandler { protected static Path move(Path what, Path fromDir, Path toDir) { if (!what.startsWith(fromDir)) throw new IllegalArgumentException(what + " is not under " + fromDir); return toDir.resolve(fromDir.relativize(what)); } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); }
Capsule implements Runnable, InvocationHandler { protected static Path move(Path what, Path fromDir, Path toDir) { if (!what.startsWith(fromDir)) throw new IllegalArgumentException(what + " is not under " + fromDir); return toDir.resolve(fromDir.relativize(what)); } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); static final void main(String[] args); @SuppressWarnings({"BroadCatchBlock", "UnusedAssignment"}) static int main0(String[] args0); static void premain(String agentArgs, Instrumentation inst); static Object getCapsule(String capletClassName); boolean isAgent(); @Override final void run(); @Override Object invoke(Object proxy, Method method, Object[] args); @Override final int hashCode(); @Override final boolean equals(Object obj); @Override String toString(); }
Capsule implements Runnable, InvocationHandler { protected static Path move(Path what, Path fromDir, Path toDir) { if (!what.startsWith(fromDir)) throw new IllegalArgumentException(what + " is not under " + fromDir); return toDir.resolve(fromDir.relativize(what)); } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); static final void main(String[] args); @SuppressWarnings({"BroadCatchBlock", "UnusedAssignment"}) static int main0(String[] args0); static void premain(String agentArgs, Instrumentation inst); static Object getCapsule(String capletClassName); boolean isAgent(); @Override final void run(); @Override Object invoke(Object proxy, Method method, Object[] args); @Override final int hashCode(); @Override final boolean equals(Object obj); @Override String toString(); static final String VERSION; }