private static void test(LFCServer lfcServer, String path) throws LFCException, URISyntaxException { clear(lfcServer, path); lfcServer.register(new URI("http://www.example.com/" + randomString()), path, 12345); FileDesc fd2; fd2 = lfcServer.fetchFileDesc(path); System.out.println("mtime=" + fd2.getMDate()); System.out.println("guid=" + fd2.getGuid()); System.out.println("size=" + fd2.getFileSize()); lfcServer.addReplica(fd2, new URI("http://www.example.com/" + randomString())); lfcServer.addReplica(fd2, new URI("http://www.example.com/" + randomString())); ArrayList<ReplicaDesc> al = lfcServer.getReplicasByPath(path); for (ReplicaDesc rd : al) { System.out.println(rd); } // String parent = path.substring(0, path.lastIndexOf("/")); // System.out.println("lfc-ls -l " + parent); // String[] s = { "-l", "-guid", "lfn://" + host + ":" + port + parent // }; // LfcCommand.doLS(s); // clear(lfcServer, path); }
private static void clear(LFCServer lfcServer, String path) { FileDesc fd; try { System.out.println("clear: path=" + path); fd = lfcServer.fetchFileDesc(path); lfcServer.deleteFile(fd.getGuid(), path); } catch (LFCException e1) { } }