Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When is a File not a File?



Hi Ian,

You can determine whether a directory should be treated like a file using
method isTraversable() of a javax.swing.filechooser.FileView object.

You can not directly create a FileView object. Create a JFileChooser first,
and then invoke getFileView() on it.
If you do it this way, you will get a FileView object which knows about the
platform specific rules for this. i.e. it will work properly for the
different Mac OS X versions and also for other operating systems.

-Werner


On 6/10/05 7:15 PM, "Ian Cheyne" at <email@hidden> wrote:
> [...]
> I don't want to know what types of "files" I am dealing with but I do
> want to know whether I am dealing with a real directory or a
> directory masquerading as a file (or application).
> 
> What is the best way to determine this?  Is it to check first of all
> whether Java believes that the file is a directory or not (using
> aFile.isDirectory()) and if it is then check to see if the name has
> an extension or not?
> 
> Best Regards,
> 
> Ian Cheyne

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >When is a File not a File? (From: Ian Cheyne <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.