Пример #1
0
  public static void copyDirectory(IVResource source, IVResource destination, boolean recurse) {
    IVResource[] list = source.listFiles();

    for (int i = 0; i < list.length; i++) {
      destination.mkdir();
      IVResource r = destination.create(list[i].getName());
      if (list[i].isDirectory()) {
        r.mkdir();
        if (recurse) {
          VResourceUtils.copyDirectory(list[i], r, recurse);
        }
      } else {
        try {
          if (!r.exists()) {
            r.createNewInstance();
            VResourceUtils.copyFile(list[i], r);
            r.flushWorkingCopy();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
    }
  }
Пример #2
0
 @Override
 public IVResource create(String path) {
   // TODO Auto-generated method stub
   return original.create(path);
 }