FileDocCategorySizeDatePackage
GUIFileSpy.javaAPI DocExample1069Tue Feb 14 13:46:54 GMT 2006None

GUIFileSpy

public class GUIFileSpy extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    File f = new File(args[0]);
    JFileChooser chooser = new JFileChooser();
    FileSystemView view = chooser.getFileSystemView();

    String name = view.getSystemDisplayName(f);
    if (view.isHiddenFile(f)) System.out.println(name + " is hidden.");
    if (view.isRoot(f)) System.out.println(name + " is a root.");
    if (view.isTraversable(f).booleanValue()) {
      System.out.println(name + " is traversable.");
    }
    System.out.println("The parent of " + name + " is " 
     + view.getParentDirectory(f));
    if (view.isFileSystem(f)) System.out.println(name + " is a regular file.");
    if (view.isFileSystemRoot(f)) System.out.println(name + " is the root.");
    if (view.isComputerNode(f)) System.out.println(name + " is the computer.");
    if (view.isDrive(f)) System.out.println(name + " is a disk.");
    if (view.isFloppyDrive(f)) System.out.println(name + " is a floppy disk.");