File file = new File( args[0] );
if ( !file.exists() || !file.canRead() ) {
System.out.println( "Can't read " + file );
return;
}
if ( file.isDirectory() ) {
String [] files = file.list();
for (int i=0; i< files.length; i++)
System.out.println( files[i] );
}
else
try {
FileInputStream fis = new FileInputStream ( file );
byte [] data = new byte [ fis.available() ];
fis.read( data );
System.out.write( data );
} catch ( FileNotFoundException e ) {
System.out.println( "File Disappeared" );
}