Esempio n. 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();
        }
      }
    }
  }
Esempio n. 2
0
 @Override
 public void createNewInstance() throws IOException {
   original.createNewInstance();
 }