Changeset 5961
- Timestamp:
- 2003-11-25T11:39:30+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSFile.java
r5261 r5961 176 176 String filename) { 177 177 return collectionBaseDir(site_home, coll_name) + File.separatorChar+ 178 " etc" + File.separatorChar + filename;178 "transform" + File.separatorChar + filename; 179 179 } 180 180 … … 329 329 } 330 330 331 public static boolean copyFile(File source, File destination) { 332 if (!source.isFile()) { 333 System.err.println("GSFile.copyFile(): "+source.getPath()+" is not a file!"); 334 return false; 335 } 336 try { 337 destination.getParentFile().mkdirs(); 338 FileInputStream in = new FileInputStream(source); 339 FileOutputStream out = new FileOutputStream(destination); 340 int value = 0; 341 while((value = in.read()) != -1) { 342 out.write(value); 343 } 344 in.close(); 345 out.close(); 346 } catch (Exception e) { 347 System.err.println("GSFile.copyFile(): something went wrong copying "+source.getPath()+" to "+destination.getPath()); 348 System.err.println("Exception: "+e.getMessage()); 349 return false; 350 } 351 352 return true; 353 } 331 354 /** Recursively moves the contents of source file to destination, 332 355 * maintaining paths. … … 375 398 return true; 376 399 } 377 400 378 401 }
Note:
See TracChangeset
for help on using the changeset viewer.