Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -rfe06d16b234341fc965d9b40494e6a2fb4cb9438 -ra934b43c55fc53c30682f35f2682570519c6c96a Binary files differ Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java =================================================================== diff -u -r65da89a116ff418593f0c5bd694b5742dcfc16e5 -ra934b43c55fc53c30682f35f2682570519c6c96a --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision 65da89a116ff418593f0c5bd694b5742dcfc16e5) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision a934b43c55fc53c30682f35f2682570519c6c96a) @@ -737,7 +737,7 @@ // copy XSLT file to contentDir, so that the XSLT document() function // does not need absolute path file. File xslt = new File(FileUtil.getFullPath(xsltDir, "ims.xslt")); - FileUtil.copyFile(xsltIn, xslt); + FileUtils.copyFile(xsltIn, xslt); // copy schema files to content folder String path = FileUtil.getFileDirectory(xsltIn.getCanonicalPath()); @@ -749,10 +749,10 @@ File imsldaTar = new File(FileUtil.getFullPath(contentDir, ExportToolContentService.SCHEMA_FILE_IMS_LD_LEVEL_A)); File imsldbTar = new File(FileUtil.getFullPath(contentDir, ExportToolContentService.SCHEMA_FILE_IMS_LD_LEVEL_B)); File imsldcTar = new File(FileUtil.getFullPath(contentDir, ExportToolContentService.SCHEMA_FILE_IMS_LD_LEVEL_C)); - FileUtil.copyFile(imscpSrc, imscpTar); - FileUtil.copyFile(imsldaSrc, imsldaTar); - FileUtil.copyFile(imsldbSrc, imsldbTar); - FileUtil.copyFile(imsldcSrc, imsldcTar); + FileUtils.copyFile(imscpSrc, imscpTar); + FileUtils.copyFile(imsldaSrc, imsldaTar); + FileUtils.copyFile(imsldbSrc, imsldbTar); + FileUtils.copyFile(imsldcSrc, imsldcTar); // create resources.xml file Document resourcesDom = new Document(); Index: lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java =================================================================== diff -u -r4028f2837af8f9467588b74061bf6799c1830196 -ra934b43c55fc53c30682f35f2682570519c6c96a --- lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java (.../FileUtil.java) (revision 4028f2837af8f9467588b74061bf6799c1830196) +++ lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java (.../FileUtil.java) (revision a934b43c55fc53c30682f35f2682570519c6c96a) @@ -459,60 +459,7 @@ return pathfile; } - public static void copyFile(File in, File out) throws Exception { - FileChannel sourceChannel = new FileInputStream(in).getChannel(); - FileChannel destinationChannel = new FileOutputStream(out).getChannel(); - sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel); - sourceChannel.close(); - destinationChannel.close(); - } - /** - * Copies a file using the provided input stream. - * - * @param inputStream - * @param targetFile - * @return size of copied file - * @throws IOException - */ - public static long copyFile(InputStream inputStream, File targetFile) throws IOException { - long result = 0; - FileOutputStream fileOutputStream = new FileOutputStream(targetFile); - byte[] data = new byte[FileUtil.FILE_COPY_BUFFER_SIZE]; - int read = 0; - do { - read = inputStream.read(data); - if (read > 0) { - fileOutputStream.write(data, 0, read); - result += read; - } - } while (read > 0); - fileOutputStream.close(); - inputStream.close(); - return result; - } - - /** - * Copies a file to the given outputStream. - */ - public static long copyFile(File sourceFile, OutputStream outputStream) throws IOException { - long result = 0; - FileInputStream fileInputStream = new FileInputStream(sourceFile); - byte[] data = new byte[FileUtil.FILE_COPY_BUFFER_SIZE]; - int read = 0; - do { - read = fileInputStream.read(data); - if (read > 0) { - outputStream.write(data, 0, read); - result += read; - } - } while (read > 0); - outputStream.close(); - fileInputStream.close(); - return result; - } - - /** * get file extension name from a String, such as from "textabc.doc", return "doc" fileName also can contain * directory infomation. */