|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.wikitty.publication.MimeTypePubHelper
public class MimeTypePubHelper
Class used to determine mimetype for an extension, used to determine type of wikittypub (data or text) with the extension and the mime type. This class is the one which handle mime type <-> file extension mapping.
| Field Summary | |
|---|---|
protected org.apache.commons.collections.BidiMap |
bidiMap
Mapping between extention and mime type, key: extension, value: mimeType |
static String |
COMMON_MIME_SEP
|
static String |
DEFAULT_MIME_TYPE
The default mime type |
static String |
JAR_TYPE
|
static String |
JAVA_TYPE
|
protected ScriptEngineManager |
manager
|
static String |
MIME_PROPERTIE
MimeType properties files name |
static String |
PREFIX_MIME_PUB_TEXT
|
static String |
PUBLICATION_MIME_SEP
|
static String |
REGEX_PUB_TEXT_TRANSFORM
match pub text that must be converted via ui decorateur text/\w*\.\w* as text/html.javascript |
| Constructor Summary | |
|---|---|
MimeTypePubHelper()
|
|
| Method Summary | |
|---|---|
void |
addExtensionMime(String extension,
String mime)
Add an entry in the map that store mapping between extension and mimeType. |
String |
getExtensionForMime(String mime)
Return the corresponding mime Type for an extension, default if not recognized |
ScriptEngineManager |
getManager()
|
String |
getMimeForExtension(String ext)
Return the corresponding mime Type for an extension, default if not recognized |
boolean |
isPubTextExtension(String extension)
used to check if a file have to be converted as a wikittyPubText with his extension similar to : isPubTextMime(getMimeForExtension(extension)) |
boolean |
isPubTextMime(String mimeType)
Used to check if a file have to be converted as a wikittyPubText |
String |
pubUiMimeToTargetMime(String mime)
Used to convert uiMime to the mimeType after content decoration |
void |
setManager(ScriptEngineManager manager)
|
String |
uiMimeContentType(String mime)
|
String |
uiMimeToFilterOptionKey(String mime)
return the convert part of a mime type, part used as a key for converter option. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String JAVA_TYPE
public static final String JAR_TYPE
protected org.apache.commons.collections.BidiMap bidiMap
protected ScriptEngineManager manager
public static String COMMON_MIME_SEP
public static String PUBLICATION_MIME_SEP
public static String PREFIX_MIME_PUB_TEXT
public static String MIME_PROPERTIE
public static String REGEX_PUB_TEXT_TRANSFORM
public static String DEFAULT_MIME_TYPE
| Constructor Detail |
|---|
public MimeTypePubHelper()
| Method Detail |
|---|
public String getExtensionForMime(String mime)
mime - the extension
public String getMimeForExtension(String ext)
ext - the extension
public boolean isPubTextMime(String mimeType)
mimeType - of the file
public String uiMimeToFilterOptionKey(String mime)
mime -
public String uiMimeContentType(String mime)
public String pubUiMimeToTargetMime(String mime)
mime -
public boolean isPubTextExtension(String extension)
extension - the file extension
public void addExtensionMime(String extension,
String mime)
extension - mime - public ScriptEngineManager getManager()
public void setManager(ScriptEngineManager manager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||