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() |
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. |
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)
public final InputStream getStream(Context context) throws FileNotFoundException
InputStream to read the content of this file.FileNotFoundException - if the file can't be found at the path specified in the
constructorpublic final String getContentType(Context context)
public 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 key