public interface FileData
OutputStream
.ReviewService.addFileToReview(com.atlassian.crucible.spi.PermId, FileData, FileData)
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases all resources under this
FileData 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.
|
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
- OutputStream
where the content will be writtenjava.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.
java.lang.String getDescription()
null
when not
provided.void close()
FileData
instance.