Interface VaultFile
-
- All Superinterfaces:
Dumpable
- All Known Implementing Classes:
VaultFileImpl
public interface VaultFile extends Dumpable
Representation of a node serialization inVaultFileSystem. All paths used have the platform format, except if explicitly mentioned otherwise.- See Also:
PlatformNameFormat
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanRead()Checks if this file can be read from (eg. if it's not a directory)AggregategetAggregate()Returns the artifacts node of this file ornullif it's transientStringgetAggregatePath()ArtifactgetArtifact()Returns the underlying artifact for this os file.VaultFilegetChild(String name)Returns the child with the given name ornullCollection<? extends VaultFile>getChildren()Returns a collection of the childrenStringgetContentType()Returns the content type of this file ornullif the type cannot be determined or if it's a directory.AggregategetControllingAggregate()Returns the aggregate that controls this file.VaultFileSystemgetFileSystem()Returns the underlying file system.StringgetName()Returns the name of this file.VaultFilegetParent()Returns the parent file ornullif this is the root file.StringgetPath()Returns the os pathCollection<? extends VaultFile>getRelated()Returns the os file set for this file.StringgetRepoRelPath()voidinvalidate()booleanisDirectory()Checks if this file is a directory.booleanisTransient()Checks if this file is transient. a file is transient if it's only used as hierarchical node for a deeper 'real' file. i.e.longlastModified()Returns the last modified date or0if not known.longlength()Returns the length of the serialized data if it's known without doing the actual serialization.
-
-
-
Method Detail
-
getPath
String getPath()
Returns the os path- Returns:
- the os path.
-
getRepoRelPath
String getRepoRelPath()
- Returns:
- the relative path of this artifact with respect to its parent node (repository format).
-
getAggregatePath
String getAggregatePath()
- Returns:
- the repository path of the artifact's root (repository format).
-
getName
String getName()
Returns the name of this file.- Returns:
- the name of this file.
-
getArtifact
Artifact getArtifact()
Returns the underlying artifact for this os file. If this file represents the Meta-Directorynullis returned.- Returns:
- the artifact or
null.
-
isDirectory
boolean isDirectory()
Checks if this file is a directory.- Returns:
trueif this file is a directory.
-
isTransient
boolean isTransient()
Checks if this file is transient. a file is transient if it's only used as hierarchical node for a deeper 'real' file. i.e.- Returns:
trueif this file is transient
-
getParent
VaultFile getParent() throws IOException, RepositoryException
Returns the parent file ornullif this is the root file.- Returns:
- the parent file.
- Throws:
IOException- if an I/O error occurs.RepositoryException- if a repository error occurs.
-
getAggregate
Aggregate getAggregate()
Returns the artifacts node of this file ornullif it's transient- Returns:
- the artifacts node
-
getControllingAggregate
Aggregate getControllingAggregate()
Returns the aggregate that controls this file.- Returns:
- the artifacts node
-
getChild
VaultFile getChild(String name) throws RepositoryException
Returns the child with the given name ornull- Parameters:
name- the name of the child- Returns:
- the child or
null - Throws:
RepositoryException- if an error occurs
-
getChildren
Collection<? extends VaultFile> getChildren() throws RepositoryException
Returns a collection of the children- Returns:
- a collection of the children
- Throws:
RepositoryException- if an error occurs
-
getRelated
Collection<? extends VaultFile> getRelated() throws RepositoryException
Returns the os file set for this file. The set contains those are the files that are generated from the same jcr file.- Returns:
- the file set of related files
- Throws:
RepositoryException- if an error occurs.
-
canRead
boolean canRead()
Checks if this file can be read from (eg. if it's not a directory)- Returns:
trueif this file can be read from.
-
lastModified
long lastModified()
Returns the last modified date or0if not known.- Returns:
- the last modified date or
0
-
length
long length()
Returns the length of the serialized data if it's known without doing the actual serialization.- Returns:
- the length or
-1if the length cannot be determined.
-
getContentType
String getContentType()
Returns the content type of this file ornullif the type cannot be determined or if it's a directory.- Returns:
- the content type or
null.
-
getFileSystem
VaultFileSystem getFileSystem()
Returns the underlying file system.- Returns:
- the Vault filesystem
-
invalidate
void invalidate() throws RepositoryException- Throws:
RepositoryException
-
-