|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectninja.utils.MimeTypes
public class MimeTypes
MimeTypes utils Adapted from play 1.2.4
Constructor Summary | |
---|---|
MimeTypes(NinjaProperties ninjaProperties)
|
Method Summary | |
---|---|
String |
getContentType(Context context,
String filename)
return the content-type from a file name. |
String |
getContentType(Context context,
String filename,
String defaultContentType)
return the content-type from a file name. |
String |
getMimeType(String filename)
return the mimetype from a file name |
String |
getMimeType(String filename,
String defaultMimeType)
return the mimetype from a file name. |
boolean |
isValidMimeType(String mimeType)
check the mimetype is referenced in the mimetypes database |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public MimeTypes(NinjaProperties ninjaProperties)
Method Detail |
---|
public String getMimeType(String filename)
filename
- the file name
public String getMimeType(String filename, String defaultMimeType)
filename
- the file namedefaultMimeType
- the default mime type to return when no matching mimetype is
found
public String getContentType(Context context, String filename)
filename
- the file name
public String getContentType(Context context, String filename, String defaultContentType)
filename
- the file namedefaultContentType
- the default content-type to return when no matching
content-type is found
public boolean isValidMimeType(String mimeType)
mimeType
- the mimeType to verify
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |