This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes file format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "file format" Watch "file format" New topic
Author

file format

raaga sree
Greenhorn

Joined: Jan 14, 2009
Posts: 5
if i select a particular file extension,the files of that format has to be listed .is thare any algorithm for that..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38057
    
  22
Welcome to JavaRanch

There are ways of doing it with JFileChooser; you can add a filter. There is a section in the Java Tutorials about that.
There are methods in the File class; you can use the isDirectory method to find whether an object represents a directory, then the list method, then on each of the Strings the lastIndexOf or endsWith methods.

Other people will doubtless think of other ways to do it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file format
 
Similar Threads
Bad Java Rule Round-up question (#235)
john
war file, tomcat and sun deployer tool
jsp
FileInputStream to read records from a text file