August 2004
Intermediate to advanced
480 pages
9h 41m
English
The following class demonstrates several different methods of the java.io.File class. These include getting the size of a file, renaming a file, and moving a file to a different directory. It also gives you some utility methods to do things you might commonly need to do, such as get the file size in bytes.
package net.javagarage.demo.io.files; import java.io.File; import java.io.IOException; import java.text.DecimalFormat; import java.text.NumberFormat; /**<p> * This class demonstrates a number of * typical things you need to do when working * with files. * </p> * @author eben hewitt * @see File, NumberFormat **/ public class CommonFileTasks { private static final String ps = File.separator; //enum new in 5.0 classname ...Read now
Unlock full access