public class ResourceFile
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
ResourceFile.MIMEType |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<ResourceFile> |
CREATOR |
static java.lang.String |
UNKNOWN_MIME_TYPE |
Constructor and Description |
---|
ResourceFile(java.lang.String filePath,
java.lang.String contentType) |
ResourceFile(java.lang.String filePath,
java.lang.String mimeType,
java.lang.String contentType) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
static ResourceFile |
fromJSON(org.json.JSONObject json) |
java.lang.String |
getContentType()
Returns the content type for the resource
|
java.lang.String |
getFilePath()
Returns the file path for the resource
|
java.lang.String |
getMimeType()
Returns the mimetype for the resource
|
static ResourceFile.MIMEType |
getMIMETypeForFile(java.lang.String fn)
Obtains the mimetype for a specific file.
|
static ResourceFile.MIMEType |
getMIMETypeForMIME(java.lang.String mime) |
long |
getSize() |
boolean |
isValid()
Is the resource file valid
|
org.json.JSONObject |
toJSON() |
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final java.lang.String UNKNOWN_MIME_TYPE
public static final android.os.Parcelable.Creator<ResourceFile> CREATOR
public ResourceFile(java.lang.String filePath, java.lang.String mimeType, java.lang.String contentType)
filePath
- the file pathmimeType
- the mime typecontentType
- the content typepublic ResourceFile(java.lang.String filePath, java.lang.String contentType)
filePath
- the file pathcontentType
- the content typepublic static ResourceFile.MIMEType getMIMETypeForFile(java.lang.String fn)
fn
- the filepublic static ResourceFile.MIMEType getMIMETypeForMIME(java.lang.String mime)
public boolean isValid()
public java.lang.String getFilePath()
public java.lang.String getMimeType()
public java.lang.String getContentType()
public java.lang.String toString()
toString
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public static ResourceFile fromJSON(org.json.JSONObject json) throws org.json.JSONException
org.json.JSONException
public org.json.JSONObject toJSON() throws org.json.JSONException
org.json.JSONException
public long getSize()