/usr/share/doc/libjcifs-java/examples/Get.java is in libjcifs-java-doc 1.3.19-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileInputStream;
import java.io.FileOutputStream;
public class Get {
public static void main( String argv[] ) throws Exception {
SmbFile f = new SmbFile( argv[0] );
SmbFileInputStream in = new SmbFileInputStream( f );
FileOutputStream out = new FileOutputStream( f.getName() );
long t0 = System.currentTimeMillis();
byte[] b = new byte[0xfffff];
int n, tot = 0;
long t1 = t0;
while(( n = in.read( b )) > 0 ) {
out.write( b, 0, n );
tot += n;
// System.out.print( '#' );
}
long t = System.currentTimeMillis() - t0;
System.out.println();
System.out.println( tot + " bytes transfered in " + ( t / 1000.0 ) + " seconds at " + (( tot / 1000.0 ) / Math.max( 1, ( t / 1000.0 ))) + "Kbytes/sec" );
in.close();
out.close();
}
}
|