import javax.swing.JFileChooser; import java.io.*; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class StegoBenchmark { protected static JFileChooser ourOpenChooser = new JFileChooser(System .getProperties().getProperty("user.dir")); static { ourOpenChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); } public void processFile(File f) { System.out.printf("%10d\t%s\n", f.length(), f.getName()); } public void processDirectory() { int action = ourOpenChooser.showOpenDialog(null); if (action == JFileChooser.APPROVE_OPTION) { File dir = ourOpenChooser.getSelectedFile(); System.out.printf("SIZE (bytes) NAME\n-----\n"); File[] list = dir.listFiles(); for (File f : list) { processFile(f); } } } public static void main(String[] args) { StegoBenchmark sb = new StegoBenchmark(); sb.processDirectory(); System.exit(0); } }