VFSUtils.writeFile(classFile, classBytes);
/** * Copy all the children from the original {@link VirtualFile} the target recursively. * * @param original the file to copy children from * @param target the file to copy the children to * @throws IOException if any problems occur copying the files */ public static void copyChildrenRecursive(VirtualFile original, VirtualFile target) throws IOException { if (original == null) { throw MESSAGES.nullArgument("Original VirtualFile"); } if (target == null) { throw MESSAGES.nullArgument("Target VirtualFile"); } List<VirtualFile> children = original.getChildren(); for (VirtualFile child : children) { VirtualFile targetChild = target.getChild(child.getName()); File childFile = child.getPhysicalFile(); if (childFile.isDirectory()) { if (!targetChild.getPhysicalFile().mkdir()) { throw MESSAGES.problemCreatingNewDirectory(targetChild); } copyChildrenRecursive(child, targetChild); } else { FileInputStream is = new FileInputStream(childFile); writeFile(targetChild, is); } } }
VFSUtils.writeFile(altDDFile, altDD.openStream()); metaData.setAlternativeDD(altDDFile.getPathName());