Changeset 29919 for other-projects/nz-flag-design/trunk/main-form
- Timestamp:
- 2015-05-22T02:30:34+12:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nz-flag-design/trunk/main-form/my-design.jsp
r29918 r29919 24 24 25 25 26 <%@ page import="java.io.*,java.util.*,java.awt.image.*,javax.imageio.*,javax.xml.bind.DatatypeConverter,java.nio.file. Files,org.json.*" %>26 <%@ page import="java.io.*,java.util.*,java.awt.image.*,javax.imageio.*,javax.xml.bind.DatatypeConverter,java.nio.file.*,org.json.*" %> 27 27 28 28 <%! 29 public static void copyFile( File from, File to ) throws IOException { 29 30 31 private static void copyFile(File source, File dest) 32 throws IOException { 33 InputStream input = null; 34 OutputStream output = null; 35 try { 36 input = new FileInputStream(source); 37 output = new FileOutputStream(dest); 38 byte[] buf = new byte[1024]; 39 int bytesRead; 40 while ((bytesRead = input.read(buf)) > 0) { 41 output.write(buf, 0, bytesRead); 42 } 43 } finally { 44 input.close(); 45 output.close(); 46 } 47 } 48 /* 49 private static void copyFileChannels(File source, File dest) 50 throws IOException { 51 FileChannel inputChannel = null; 52 FileChannel outputChannel = null; 53 try { 54 inputChannel = new FileInputStream(source).getChannel(); 55 outputChannel = new FileOutputStream(dest).getChannel(); 56 outputChannel.transferFrom(inputChannel, 0, inputChannel.size()); 57 } finally { 58 inputChannel.close(); 59 outputChannel.close(); 60 } 61 } 62 63 */ 64 /* 65 public static void copyFile_JAVA17( File from, File to ) throws IOException { 30 66 Files.copy( from.toPath(), to.toPath() ); 31 67 } 68 */ 32 69 33 70 public static void publishFile(File myFlagFile, File pubFlagFile)
Note:
See TracChangeset
for help on using the changeset viewer.