Exemplo n.º 1
0
 @Override
 public void rmDir(final INode node) {
   Object obj = sendReceive(new RmMessage(node.getFullPath()));
   if (obj instanceof Success) {
     System.out.println("Successfully removed " + node.getFullPath());
   } else if (obj instanceof Failure) {
     System.out.println(
         "Failed to remove " + node.getFullPath() + " because " + ((Failure) obj).getMessage());
   }
 }
Exemplo n.º 2
0
 @Override
 public void mvFile(final INode src, final INode dest) throws Exception {
   Object obj = sendReceive(new MoveMessage(new File(src), new File(dest)));
   if (obj instanceof Success) {
     System.out.println(
         "Successfully moved from " + src.getFullPath() + " to " + dest.getFullPath());
   } else if (obj instanceof Failure) {
     throw new Exception(
         "Failed to move from "
             + src.getFullPath()
             + " to "
             + dest.getFullPath()
             + " because "
             + ((Failure) obj).getMessage());
   }
 }
Exemplo n.º 3
0
 @Override
 public void addDir(final INode node) {
   addDir(node.getFullPath());
 }