Mailing Lists: Apple Mailing Lists

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

When is a File not a File?



Answer: When its actually a Directory.

In my application I am placing documents into a mySQL database from a Java client application. All is well for ordinary files but I am having problems with files that are in fact directories. The files in question are Keynote and Pages files. These files turn out not to be files but directories in much the same way as Applications are directories. They are directories with the extension ".pages" and ".key".

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


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.