| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.alembik.util.MimeTypesRepository
public class MimeTypesRepository
The dictionary providing bidirectional mapping between file extensions and mime-types. Actual bindings are provided in the two accompanying files:
NOTE: since the relation between the two is not unequivocal, one cannot assume the following condition always be true:
contentType.equals (getContentType (getExtension (contentType)))
| Method Summary | |
|---|---|
|  java.lang.String | getContentType(java.lang.String extension)Finds the content type for the given file extension. | 
|  java.lang.String | getExtension(java.lang.String contentType)Finds the file extension for the given content type. | 
| static MimeTypesRepository | getInstance()Return the singleton instance of this component. | 
| static java.lang.Class<? extends Media> | getMediaClass(java.lang.String contentType)Returns the media class corresponding to the given content type. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static MimeTypesRepository getInstance()
public java.lang.String getExtension(java.lang.String contentType)
Finds the file extension for the given content type.
For example image/gif gets resolved into gif.
contentType - mime-type to be resolved
public java.lang.String getContentType(java.lang.String extension)
Finds the content type for the given file extension.
For example jpg gets resolved into image/jpeg.
extension - to be resolved
public static java.lang.Class<? extends Media> getMediaClass(java.lang.String contentType)
contentType - mime-type string
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||