I see that Java 8 has significantly cleaned up reading the contents of a file into a String:
String contents = new String(Files.readAllBytes(Paths.get(new URI(so
This version uses Files.walk and Path parameters as Java 8 suggests.
public static void copyFolder(Path src, Path dest) {
try {
Files.walk( src ).forEach( s -> {
try {
Path d = dest.resolve( src.relativize(s) );
if( Files.isDirectory( s ) ) {
if( !Files.exists( d ) )
Files.createDirectory( d );
return;
}
Files.copy( s, d );// use flag to override existing
} catch( Exception e ) {
e.printStackTrace();
}
});
} catch( Exception ex ) {
ex.printStackTrace();
}
}