Class RepositoryFile
- java.lang.Object
-
- org.pentaho.platform.repository.solution.dbbased.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 Summary
Fields Modifier and Type Field Description protected boolean
directory
static char
EXTENSION_CHAR
protected String
fileId
protected String
fileName
protected String
fullPath
protected long
lastModified
protected RepositoryFile
parent
protected int
revision
-
Constructor Summary
Constructors Constructor Description RepositoryFile()
RepositoryFile(String fileName, RepositoryFile parent, byte[] data)
RepositoryFile(String fileName, RepositoryFile parent, byte[] data, long lastModified)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildFile(RepositoryFile file)
int
compareTo(Object o)
boolean
containsActions()
boolean
equals(Object other)
boolean
exists()
List<org.pentaho.platform.api.engine.IPentahoAclEntry>
getAccessControls()
Set
getChildrenFiles()
byte[]
getData()
protected boolean
getDirectory()
List<org.pentaho.platform.api.engine.IPentahoAclEntry>
getEffectiveAccessControls()
Chains up to find the access controls that are in force on this object.String
getExtension()
String
getFileId()
String
getFileName()
String
getFullPath()
long
getLastModified()
RepositoryFile
getParent()
String
getPhraseSearchQueryName()
int
getRevision()
String[]
getSearchableColumns()
String
getSearchableTable()
String
getSolution()
String
getSolutionPath()
protected RepositoryFile
getTopFolder()
boolean
hasExtension()
int
hashCode()
boolean
isDirectory()
boolean
isRoot()
org.pentaho.platform.api.engine.ISolutionFile[]
listFiles()
org.pentaho.platform.api.engine.ISolutionFile[]
listFiles(org.pentaho.platform.api.engine.IFileFilter filter)
RepositoryFile[]
listRepositoryFiles()
void
removeChildFile(RepositoryFile file)
void
resetAccessControls(List<org.pentaho.platform.api.engine.IPentahoAclEntry> acls)
protected void
resolvePath()
org.pentaho.platform.api.engine.ISolutionFile
retrieveParent()
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.void
setChildrenFiles(Set childrenFiles)
void
setData(byte[] data)
protected void
setDirectory(boolean directory)
protected void
setFileId(String fileId)
protected void
setFileName(String fileName)
protected void
setFullPath(String fullPath)
void
setLastModified(long modDate)
void
setParent(RepositoryFile parent)
protected void
setRevision(int revision)
-
-
-
Field Detail
-
EXTENSION_CHAR
public static final char EXTENSION_CHAR
- See Also:
- Constant Field Values
-
revision
protected int revision
-
fileId
protected String fileId
-
parent
protected RepositoryFile parent
-
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)
-
RepositoryFile
public RepositoryFile(String fileName, RepositoryFile parent, byte[] data, long lastModified)
-
-
Method Detail
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object other)
-
resolvePath
protected void resolvePath()
-
getAccessControls
public List<org.pentaho.platform.api.engine.IPentahoAclEntry> getAccessControls()
- Specified by:
getAccessControls
in interfaceorg.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 interfaceorg.pentaho.platform.api.engine.IAclHolder
-
resetAccessControls
public void resetAccessControls(List<org.pentaho.platform.api.engine.IPentahoAclEntry> acls)
- Specified by:
resetAccessControls
in interfaceorg.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 interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
getSolutionPath
public String getSolutionPath()
- Specified by:
getSolutionPath
in interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
getFileName
public String getFileName()
- Specified by:
getFileName
in interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
setFileName
protected void setFileName(String fileName)
-
getFullPath
public String getFullPath()
- Specified by:
getFullPath
in interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
setFullPath
protected void setFullPath(String fullPath)
-
setParent
public void setParent(RepositoryFile parent)
-
getParent
public RepositoryFile getParent()
-
retrieveParent
public org.pentaho.platform.api.engine.ISolutionFile retrieveParent()
- Specified by:
retrieveParent
in interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
getTopFolder
protected RepositoryFile getTopFolder()
-
getSearchableColumns
public String[] getSearchableColumns()
- Specified by:
getSearchableColumns
in interfaceorg.pentaho.platform.api.repository.ISearchable
-
getSearchableTable
public String getSearchableTable()
- Specified by:
getSearchableTable
in interfaceorg.pentaho.platform.api.repository.ISearchable
-
getPhraseSearchQueryName
public String getPhraseSearchQueryName()
- Specified by:
getPhraseSearchQueryName
in interfaceorg.pentaho.platform.api.repository.ISearchable
-
setDirectory
protected void setDirectory(boolean directory)
-
getDirectory
protected boolean getDirectory()
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory
in interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
getChildrenFiles
public Set getChildrenFiles()
- Specified by:
getChildrenFiles
in interfaceorg.pentaho.platform.api.engine.IAclSolutionFile
- Returns:
- Returns the childrenResources.
-
setChildrenFiles
public void setChildrenFiles(Set childrenFiles)
- Parameters:
childrenFiles
- The childrenResources to set.
-
addChildFile
public void addChildFile(RepositoryFile file)
-
removeChildFile
public void removeChildFile(RepositoryFile file)
-
getData
public byte[] getData()
- Specified by:
getData
in interfaceorg.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 interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
listFiles
public org.pentaho.platform.api.engine.ISolutionFile[] listFiles()
- Specified by:
listFiles
in interfaceorg.pentaho.platform.api.engine.ISolutionFile
-
listRepositoryFiles
public RepositoryFile[] listRepositoryFiles()
-
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interfaceComparable
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceorg.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 interfaceorg.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 interfaceorg.pentaho.platform.api.engine.ISolutionFile
- Returns:
- the extension (including the . seperator) of this file
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.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 interfaceorg.pentaho.platform.api.engine.IAclHolder
-
-