/** * Copies all the files in the package folder [folder] to the nominated dest, * and returns a list of all the file names copied * * @param folder * @return * @throws IOException */ public List<String> copyTo(String folder, String dest) throws IOException { List<String> res = new ArrayList<String>(); if (path != null) { copyToDest(Utilities.path(path, folder), Utilities.path(path, folder), dest, res); } else { for (Entry<String, byte[]> e : content.entrySet()) { if (e.getKey().startsWith(folder+"/")) { String s = e.getKey().substring(folder.length()+1); res.add(s); String dst = Utilities.path(dest, s); String dstDir = Utilities.getDirectoryForFile(dst); Utilities.createDirectory(dstDir); TextFile.bytesToFile(e.getValue(), dst); } } } return res; }
/** * Copies all the files in the package folder [folder] to the nominated dest, * and returns a list of all the file names copied * * @param folder * @return * @throws IOException */ public List<String> copyTo(String folder, String dest) throws IOException { List<String> res = new ArrayList<String>(); if (path != null) { copyToDest(Utilities.path(path, folder), Utilities.path(path, folder), dest, res); } else { for (Entry<String, byte[]> e : content.entrySet()) { if (e.getKey().startsWith(folder+"/")) { String s = e.getKey().substring(folder.length()+1); res.add(s); String dst = Utilities.path(dest, s); String dstDir = Utilities.getDirectoryForFile(dst); Utilities.createDirectory(dstDir); TextFile.bytesToFile(e.getValue(), dst); } } } return res; }