|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FileData
This interface is used by SPI users to feed a file to Crucible. It provides
information about the file's content and gives access to its data by writing
it to an OutputStream
.
ReviewService.addFileToReview(com.atlassian.crucible.spi.PermId, FileData, FileData)
Method Summary | |
---|---|
void |
close()
Releases all resources under this instance. |
java.lang.String |
getCharSet()
Specifies the character set of the contents for text files (e.g. |
void |
getContents(java.io.OutputStream out)
Writes the contents of the file data to the given OutputStream . |
java.lang.String |
getContentType()
Returns the content type, e.g. |
java.lang.String |
getDescription()
Returns a string describing the content, or null when not
provided. |
java.lang.String |
getName()
Returns the original name of the resource. |
Method Detail |
---|
void getContents(java.io.OutputStream out) throws java.io.IOException, java.lang.IllegalStateException
OutputStream
.
The implementation does not close the given stream when finished and it
is the responsibility of the caller to close the OutputStream
when
appropriate.
Note that the data represented by an instance of this interface may not be present as a file on disk, but may in fact be provided by a real-time stream. As a result, the data can be read only once and this method should not be called for a second time.
out
-
java.io.IOException
- when an error occured while writing the contents to
the specified OutputStream
.
java.lang.IllegalStateException
- when the content has already been written
to a stream (this happens when this method is called for a second time).java.lang.String getContentType()
java.lang.String getName()
java.lang.String getCharSet()
null, Crucible will use the server's default
character set.
- Returns:
java.lang.String getDescription()
null
when not
provided.
void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |