Interface WriteableModelSource
-
- All Known Implementing Classes:
BaseFileResourceModelSource
,FileResourceModelSource
public interface WriteableModelSource
A ResourceModelSource that can write formatted model data- Since:
- 9/5/17
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getSourceDescription()
java.lang.String
getSyntaxMimeType()
boolean
hasData()
long
readData(java.io.OutputStream sink)
read current data into the sinklong
writeData(java.io.InputStream data)
Write new data in the expected format
-
-
-
Method Detail
-
getSyntaxMimeType
java.lang.String getSyntaxMimeType()
- Returns:
- the mime type of the data
-
getSourceDescription
default java.lang.String getSourceDescription()
- Returns:
- optional description of the source
-
readData
long readData(java.io.OutputStream sink) throws java.io.IOException, ResourceModelSourceException
read current data into the sink- Parameters:
sink
-- Returns:
- bytes written
- Throws:
java.io.IOException
ResourceModelSourceException
-
hasData
boolean hasData()
- Returns:
- true if the call to
readData(OutputStream)
is expected to succeed.
-
writeData
long writeData(java.io.InputStream data) throws java.io.IOException, ResourceModelSourceException
Write new data in the expected format- Parameters:
data
- data- Returns:
- bytes written
- Throws:
java.io.IOException
- if an IO error occursResourceModelSourceException
- if the data is not valid
-
-