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