This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes How to get File extension? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to get File extension?" Watch "How to get File extension?" New topic
Author

How to get File extension?

ksp shenoy
Greenhorn

Joined: Jun 20, 2004
Posts: 4
Hi all,

I need to determine the extension (or MIME type...) of a file in JAVA..How can I do this...?

Thanks
KSPShenoy
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 9137
    
    9

Getting the extension is easy.


MIME type is a bit more complex. The only place I've seen it used is in the JavaBeans Activation Framework which, given a data source, will use the MIME type to find applications which can handle that data. It's used in the JavaMail framework.


[How To Ask Questions On JavaRanch]
 
Have you checked out Aspose?
 
subject: How to get File extension?
 
It's not a secret anymore!