public class UploadFile extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<UploadFile> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
UploadFile(String path)
Creates a new UploadFile.
|
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
boolean |
equals(Object o) |
String |
getContentType(Context context)
Returns the content type for the file
|
String |
getName(Context context)
Returns the name of this file.
|
String |
getPath()
Returns the string this was initialized with,
either an absolute file path or Android content URI
|
String |
getProperty(String key)
Gets a property associated to this file.
|
String |
getProperty(String key,
String defaultValue)
Gets a property associated to this file.
|
InputStream |
getStream(Context context)
Gets the
InputStream to read the content of this file. |
int |
hashCode() |
long |
length(Context context)
Gets the file length in bytes.
|
void |
setProperty(String key,
String value)
Sets a property for this file.
|
void |
writeToParcel(Parcel parcel,
int arg1) |
public static final Parcelable.Creator<UploadFile> CREATOR
public UploadFile(String path) throws FileNotFoundException
path - absolute path to a file or an Android content Uri stringFileNotFoundException - if the file can't be found at the specified pathIllegalArgumentException - if you passed invalid argument valuespublic long length(Context context)
context - service contextpublic final InputStream getStream(Context context) throws FileNotFoundException
InputStream to read the content of this file.context - service contextFileNotFoundException - if the file can't be found at the path specified in the
constructorpublic final String getContentType(Context context)
context - service contextpublic final String getName(Context context)
context - service contextpublic final String getPath()
public int describeContents()
describeContents in interface Parcelablepublic void writeToParcel(Parcel parcel, int arg1)
writeToParcel in interface Parcelablepublic void setProperty(String key, String value)
key - property keyvalue - property valuepublic String getProperty(String key)
key - property keypublic String getProperty(String key, String defaultValue)
key - property keydefaultValue - default value to use if the key does not exist or the value is null