|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.document.FileDocument
public class FileDocument
This class presents a Document interface for a specific file on disk.
Constructor Summary | |
---|---|
FileDocument(File file)
Create a new File Document. |
|
FileDocument(File file,
MimeMediaType type)
Create a new File Document. |
Method Summary | |
---|---|
String |
getFileExtension()
Returns the file extension type used by this Document . |
MimeMediaType |
getMimeType()
Returns the MIME Media type of this Document per
IETF RFC 2046 MIME : Media Types. |
InputStream |
getStream()
Returns the stream of bytes which represents the content of this Document . |
void |
sendToStream(OutputStream sink)
Send the contents of this Document to the specified stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileDocument(File file)
public FileDocument(File file, MimeMediaType type)
Method Detail |
---|
public String getFileExtension()
Document
. This
value is usually chosen based upon the MIME Media Type.
Returns everything after the last '.' in the filename, or the
empty string if the file name does not contain a '.'.
getFileExtension
in interface Document
Document
.public MimeMediaType getMimeType()
Document
per
IETF RFC 2046 MIME : Media Types.
JXTA does not currently support the 'Multipart
' or
'Message
' media types.
getMimeType
in interface Document
Document
.public InputStream getStream() throws IOException
Document
.
getStream
in interface DocumentStreamIO
InputStream
containing the bytes
of this Document
.
IOException
- For errors while writing the Document
.public void sendToStream(OutputStream sink) throws IOException
Document
to the specified stream.
sendToStream
in interface DocumentStreamIO
sink
- The OutputStream to which the Document
will
be written.
IOException
- For errors while writing the Document
.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |