Class RepositoryFile

  • All Implemented Interfaces:
    Serializable, Comparable, org.pentaho.platform.api.engine.IAclHolder, org.pentaho.platform.api.engine.IAclSolutionFile, org.pentaho.platform.api.engine.IPentahoAclObjectIdentity, org.pentaho.platform.api.engine.ISolutionFile, org.pentaho.platform.api.repository.ISearchable

    public class RepositoryFile
    extends Object
    implements org.pentaho.platform.api.repository.ISearchable, Comparable, org.pentaho.platform.api.engine.IPentahoAclObjectIdentity, org.pentaho.platform.api.engine.IAclSolutionFile, org.pentaho.platform.api.engine.ISolutionFile
    See Also:
    Serialized Form
    • Field Detail

      • revision

        protected int revision
      • fileId

        protected String fileId
      • fileName

        protected String fileName
      • fullPath

        protected String fullPath
      • lastModified

        protected long lastModified
      • directory

        protected boolean directory
    • Constructor Detail

      • RepositoryFile

        public RepositoryFile()
      • RepositoryFile

        public RepositoryFile​(String fileName,
                              RepositoryFile parent,
                              byte[] data,
                              long lastModified)
    • Method Detail

      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface org.pentaho.platform.api.engine.IPentahoAclObjectIdentity
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object other)
        Specified by:
        equals in interface org.pentaho.platform.api.engine.IPentahoAclObjectIdentity
        Overrides:
        equals in class Object
      • resolvePath

        protected void resolvePath()
      • getAccessControls

        public List<org.pentaho.platform.api.engine.IPentahoAclEntry> getAccessControls()
        Specified by:
        getAccessControls in interface org.pentaho.platform.api.engine.IAclHolder
      • setAccessControls

        public void setAccessControls​(List<org.pentaho.platform.api.engine.IPentahoAclEntry> acls)
        This method's purpose is to allow Hibernate to initialize the ACLs from the data-store. Application clients should likely use resetAccessControls.
        Specified by:
        setAccessControls in interface org.pentaho.platform.api.engine.IAclHolder
      • resetAccessControls

        public void resetAccessControls​(List<org.pentaho.platform.api.engine.IPentahoAclEntry> acls)
        Specified by:
        resetAccessControls in interface org.pentaho.platform.api.engine.IAclHolder
      • getRevision

        public int getRevision()
      • setRevision

        protected void setRevision​(int revision)
      • getFileId

        public String getFileId()
      • setFileId

        protected void setFileId​(String fileId)
      • getSolution

        public String getSolution()
        Specified by:
        getSolution in interface org.pentaho.platform.api.engine.ISolutionFile
      • getSolutionPath

        public String getSolutionPath()
        Specified by:
        getSolutionPath in interface org.pentaho.platform.api.engine.ISolutionFile
      • getFileName

        public String getFileName()
        Specified by:
        getFileName in interface org.pentaho.platform.api.engine.ISolutionFile
      • setFileName

        protected void setFileName​(String fileName)
      • getFullPath

        public String getFullPath()
        Specified by:
        getFullPath in interface org.pentaho.platform.api.engine.ISolutionFile
      • setFullPath

        protected void setFullPath​(String fullPath)
      • retrieveParent

        public org.pentaho.platform.api.engine.ISolutionFile retrieveParent()
        Specified by:
        retrieveParent in interface org.pentaho.platform.api.engine.ISolutionFile
      • getSearchableColumns

        public String[] getSearchableColumns()
        Specified by:
        getSearchableColumns in interface org.pentaho.platform.api.repository.ISearchable
      • getSearchableTable

        public String getSearchableTable()
        Specified by:
        getSearchableTable in interface org.pentaho.platform.api.repository.ISearchable
      • getPhraseSearchQueryName

        public String getPhraseSearchQueryName()
        Specified by:
        getPhraseSearchQueryName in interface org.pentaho.platform.api.repository.ISearchable
      • setDirectory

        protected void setDirectory​(boolean directory)
      • getDirectory

        protected boolean getDirectory()
      • isDirectory

        public boolean isDirectory()
        Specified by:
        isDirectory in interface org.pentaho.platform.api.engine.ISolutionFile
      • getChildrenFiles

        public Set getChildrenFiles()
        Specified by:
        getChildrenFiles in interface org.pentaho.platform.api.engine.IAclSolutionFile
        Returns:
        Returns the childrenResources.
      • setChildrenFiles

        public void setChildrenFiles​(Set childrenFiles)
        Parameters:
        childrenFiles - The childrenResources to set.
      • removeChildFile

        public void removeChildFile​(RepositoryFile file)
      • getData

        public byte[] getData()
        Specified by:
        getData in interface org.pentaho.platform.api.engine.ISolutionFile
        Returns:
        Returns the data.
      • setData

        public void setData​(byte[] data)
        Parameters:
        data - The data to set.
      • listFiles

        public org.pentaho.platform.api.engine.ISolutionFile[] listFiles​(org.pentaho.platform.api.engine.IFileFilter filter)
        Specified by:
        listFiles in interface org.pentaho.platform.api.engine.ISolutionFile
      • listFiles

        public org.pentaho.platform.api.engine.ISolutionFile[] listFiles()
        Specified by:
        listFiles in interface org.pentaho.platform.api.engine.ISolutionFile
      • getLastModified

        public long getLastModified()
        Specified by:
        getLastModified in interface org.pentaho.platform.api.engine.ISolutionFile
        Returns:
        Returns the modDate.
      • setLastModified

        public void setLastModified​(long modDate)
        Parameters:
        modDate - The modDate to set.
      • containsActions

        public boolean containsActions()
      • isRoot

        public boolean isRoot()
        Specified by:
        isRoot in interface org.pentaho.platform.api.engine.ISolutionFile
      • hasExtension

        public boolean hasExtension()
        Returns:
        a boolean indicating if this file has an extension
      • getExtension

        public String getExtension()
        Specified by:
        getExtension in interface org.pentaho.platform.api.engine.ISolutionFile
        Returns:
        the extension (including the . seperator) of this file
      • exists

        public boolean exists()
        Specified by:
        exists in interface org.pentaho.platform.api.engine.ISolutionFile
      • getEffectiveAccessControls

        public List<org.pentaho.platform.api.engine.IPentahoAclEntry> getEffectiveAccessControls()
        Chains up to find the access controls that are in force on this object. Could end up chaining all the way to the root.

        Note that (1) defining no access control entries of your own and (2) removing all of your access control entries is indistiguishable in the current design. In #1, we chain up because we inherit. But in #2, it might be expected that by explicitly removing all access control entries, the chaining up ends. That is not the case in the current design.

        Specified by:
        getEffectiveAccessControls in interface org.pentaho.platform.api.engine.IAclHolder