Class BaseFileResourceModelSource

    • Constructor Detail

      • BaseFileResourceModelSource

        public BaseFileResourceModelSource​(Framework framework)
    • Method Detail

      • getResourceFormat

        protected abstract java.lang.String getResourceFormat()
        Returns:
        the name of the supported ResourceFormatParser provider, or null if the file extension is used
      • getDocumentFileExtension

        protected abstract java.lang.String getDocumentFileExtension()
        Returns:
        the file extension of the document, or the getResourceFormat() must be used.
      • writeFileData

        public abstract long writeFileData​(java.io.InputStream tempStream)
                                    throws java.io.IOException
        Write the file data from the inputstream to the backing store
        Parameters:
        tempStream - input stream
        Returns:
        bytes writen
        Throws:
        java.io.IOException
      • writeFileData

        protected long writeFileData​(long length,
                                     java.io.InputStream tempStream)
                              throws java.io.IOException
        Write the file data from the inputstream to the backing store, this implementation calls writeFileData(InputStream) but can be overridden
        Parameters:
        length - data length
        tempStream - input stream
        Returns:
        bytes writen
        Throws:
        java.io.IOException
      • isDataWritable

        public boolean isDataWritable()
        Returns:
        true if the model source is writable, false if the data should not be modified with writeData(InputStream)
      • shouldGenerateServerNode

        protected boolean shouldGenerateServerNode()
        Returns:
        true if the node set should always include the local server node data
      • isSupportsLastModified

        protected boolean isSupportsLastModified()
        Returns:
        true if the underlying data set supports a "last modified" timestamp which should be used to determine whether the nodes data should be reloaded or cached data can be used
      • getLastModified

        protected long getLastModified()
        Returns:
        last modified unix timestamp, or -1 if not available