aspose file tools*
The moose likes I/O and Streams and the fly likes How to find the extention of file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to find the extention of file" Watch "How to find the extention of file" New topic
Author

How to find the extention of file

Shyam Purkayastha
Ranch Hand

Joined: Jan 15, 2001
Posts: 57
Hi all
Whenever we use a JFileChooser to get a file it returns a File object.My question is weather it is possible to get the file extension string from the File object.If yes then how?
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Shyam,
the extension is the substring beginning with the last dot. For example:

Hope this helps.


Mag
li dalong
Greenhorn

Joined: Nov 14, 2002
Posts: 2
I want to think return .exe?what do me??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find the extention of file