Velocity Reviews - Computer Hardware Reviews

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

Thread Tools

Detecting document types

Posts: n/a
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

Reply With Quote

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 Java 1 09-23-2007 07:57 AM
Detecting the opening of file types 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