|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.activation.URLDataSource
ch.randelshofer.activation.FileTypeMappedURLDataSource
public class FileTypeMappedURLDataSource
An extension to URLDataSource which tries to guess the content type of the URL by using the default FileTypeMap when the URLConnection returns 'content/unknown' or 'application/octet-stream'.
| Constructor Summary | |
|---|---|
FileTypeMappedURLDataSource(java.net.URL url)
FileTypeMappedURLDataSource constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
Returns the value of the URL content-type header field. |
| Methods inherited from class javax.activation.URLDataSource |
|---|
getInputStream, getName, getOutputStream, getURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileTypeMappedURLDataSource(java.net.URL url)
The FileTypedMappedURLDataSource class will not open a connection to the URL until a method requiring it to do so is called.
url - The URL to be encapsulated in this object.| Method Detail |
|---|
public java.lang.String getContentType()
If this gives not a satisfactory result (either 'content/unknown' or 'application/octet-stream') then this method uses the currently installed FileTypeMap to guess the content type.
getContentType in interface javax.activation.DataSourcegetContentType in class javax.activation.URLDataSource
|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||