public class FileResourceModelSource extends BaseFileResourceModelSource implements Configurable
BaseFileResourceModelSource
to
provide an optionally editable Model source using a local file system path.Modifier and Type | Class and Description |
---|---|
static class |
FileResourceModelSource.Configuration |
framework, nodeSet
Modifier and Type | Method and Description |
---|---|
void |
configure(FileResourceModelSource.Configuration configuration)
Configure the Source
|
void |
configure(java.util.Properties configs)
Configure the object with the configuration properties.
|
protected java.lang.String |
getDocumentFileExtension() |
protected long |
getLastModified() |
protected java.lang.String |
getResourceFormat() |
java.lang.String |
getSourceDescription() |
boolean |
hasData() |
boolean |
isDataWritable() |
protected boolean |
isSupportsLastModified() |
java.io.InputStream |
openFileDataInputStream() |
static INodeSet |
parseFile(java.io.File file,
Framework framework,
java.lang.String project)
Utility method to directly parse the nodes from a file
|
static INodeSet |
parseFile(java.io.File file,
java.lang.String format,
Framework framework,
java.lang.String project)
Utility method to directly parse the nodes from a file
|
protected boolean |
shouldGenerateServerNode() |
java.lang.String |
toString() |
long |
writeFileData(java.io.InputStream dataStream)
Write the file data from the inputstream to the backing store
|
getNodes, getNodes, getResourceFormatParser, getSourceType, getSyntaxMimeType, getWriteable, readData, writeData
public void configure(java.util.Properties configs) throws ConfigurationException
Configurable
configure
in interface Configurable
configs
- the properties to useConfigurationException
- if there is an invalid configurationpublic void configure(FileResourceModelSource.Configuration configuration) throws ConfigurationException
configuration
- configurationConfigurationException
- on config errorpublic long writeFileData(java.io.InputStream dataStream) throws java.io.IOException
BaseFileResourceModelSource
writeFileData
in class BaseFileResourceModelSource
dataStream
- input streamjava.io.IOException
public java.io.InputStream openFileDataInputStream() throws java.io.IOException, ResourceModelSourceException
openFileDataInputStream
in class BaseFileResourceModelSource
java.io.IOException
ResourceModelSourceException
public boolean hasData()
hasData
in interface WriteableModelSource
WriteableModelSource.readData(OutputStream)
is expected to succeed.protected boolean isSupportsLastModified()
isSupportsLastModified
in class BaseFileResourceModelSource
protected long getLastModified()
getLastModified
in class BaseFileResourceModelSource
protected java.lang.String getResourceFormat()
getResourceFormat
in class BaseFileResourceModelSource
protected java.lang.String getDocumentFileExtension()
getDocumentFileExtension
in class BaseFileResourceModelSource
BaseFileResourceModelSource.getResourceFormat()
must be used.public java.lang.String getSourceDescription()
getSourceDescription
in interface WriteableModelSource
public boolean isDataWritable()
isDataWritable
in class BaseFileResourceModelSource
BaseFileResourceModelSource.writeData(InputStream)
protected boolean shouldGenerateServerNode()
shouldGenerateServerNode
in class BaseFileResourceModelSource
public static INodeSet parseFile(java.io.File file, Framework framework, java.lang.String project) throws ResourceModelSourceException, ConfigurationException
file
- fileframework
- fwkproject
- project nameResourceModelSourceException
- if an error occursConfigurationException
- if a configuration error occurspublic static INodeSet parseFile(java.io.File file, java.lang.String format, Framework framework, java.lang.String project) throws ResourceModelSourceException, ConfigurationException
file
- fileformat
- specified formatframework
- fwkproject
- project nameResourceModelSourceException
- if an error occursConfigurationException
- if a configuration error occurspublic java.lang.String toString()
toString
in class java.lang.Object