Import java. Io. file;
Import java. Io. fileinputstream;
Import java. Io. filenotfoundexception;
Import java. Io. fileoutputstream;
Import java. Io. ioexception;
Public class helloword {
Public static void main (string [] ARGs ){
Helloword H = new helloword ();
H. copyfiletofile ();
}
Public void copyfiletofile (){
String Path = helloword. Class. getresource ("a.txt"). GetFile ();
File F1 = new file (PATH );
System. Out. println (PATH );
File F2 = new file ("/home/kitten/B .txt ");
Try {
Fileinputstream FCM = new fileinputstream (F1 );
Byte [] B = new byte [1024];
FS. Read (B );
String S = new string (B );
System. Out. println (s );
Fileoutputstream Fos = new fileoutputstream (F2 );
FOS. Write (B );
} Catch (filenotfoundexception e ){
// Todo auto-generated Catch Block
E. printstacktrace ();
} Catch (ioexception e ){
// Todo auto-generated Catch Block
E. printstacktrace ();
}
}
}