Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Detecting document types

Reply
Thread Tools

Detecting document types

 
 
Chris
Guest
Posts: n/a
 
      11-24-2003
We need to detect the type of document being fetched via http. Sometimes the
extension works (.html, .doc) and sometimes the http server sends a
Content-Type header. But sometimes both fail.

A better alternative would be URLConnection.guessContentTypeFromStream(),
but the implementation that comes with JDK 1.4 is really limited.

Supposedly Unix has a utility that will do this. Does anyone know of a Java
implementation?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting support for event types RobG Javascript 15 08-22-2008 03:55 AM
Detecting mime types smcardle@smcardle.com Java 1 09-23-2007 07:57 AM
Detecting the opening of file types tazmaster2@gmail.com Java 1 05-07-2007 12:25 AM
detecting variable types Jay Python 15 09-25-2004 10:19 PM
detecting basic types Lasse Skyum C++ 6 12-24-2003 09:43 AM



Advertisments