|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object retrofit.mime.TypedFile
public class TypedFile
File and its mime type.
Constructor Summary | |
---|---|
TypedFile(String mimeType,
File file)
Constructs a new typed file. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
File |
file()
Returns the file. |
String |
fileName()
Original filename. |
int |
hashCode()
|
InputStream |
in()
Read bytes as stream. |
long |
length()
Length in bytes. |
String |
mimeType()
Returns the mime type. |
void |
moveTo(TypedFile destination)
Atomically moves the contents of this file to a new location. |
String |
toString()
|
void |
writeTo(OutputStream out)
Writes these bytes to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TypedFile(String mimeType, File file)
NullPointerException
- if file or mimeType is nullMethod Detail |
---|
public File file()
public String mimeType()
TypedInput
mimeType
in interface TypedInput
mimeType
in interface TypedOutput
public long length()
TypedInput
-1
if length is unknown.
length
in interface TypedInput
length
in interface TypedOutput
public String fileName()
TypedOutput
fileName
in interface TypedOutput
public InputStream in() throws IOException
TypedInput
in
in interface TypedInput
IOException
public void writeTo(OutputStream out) throws IOException
TypedOutput
writeTo
in interface TypedOutput
IOException
public void moveTo(TypedFile destination) throws IOException
destination
- file
IOException
- if the move failspublic String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |