try {
File src = new File( "test.dat" );
File dest = new File( "test.dat.bak" );
FileUtils.copyFile( src, dest );
} catch( IOException ioe ) {
System.out.println( "Problem copying file." );
}
try {
File src = new File( "test.dat" );
File dir = new File( "./temp" );
FileUtils.copyFileToDirectory( src, dir );
} catch( IOException ioe ) {
System.out.println( "Problem copying file to dir.");
}
try {
String string = "Blah blah blah";
File dest = new File( "test.tmp" );
FileUtils.writeStringToFile( dest, string, "ISO-8859-1" );
} catch( IOException ioe ) {
System.out.println( "Error writing out a String." );
}