Class AbstractArtifact
java.lang.Object
org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
- Direct Known Subclasses:
DirectoryArtifact,HintArtifact,PropertyValueArtifact,SerializerArtifact
Implements a generic abstract artifact
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractArtifact(Artifact parent, String repoRelPath, String extension, ArtifactType type) Creates a new abstract artifact with the given repository name, platform extension and and type. the parent artifact is only used for generating the paths and is not linked to this artifact.protectedAbstractArtifact(Artifact base, ArtifactType type) Creates a new abstract artifact initialized with the values from the given one. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(DumpContext ctx, boolean isLast) Dumps some human readable information using the given context.booleanReturns the content type of the serialized data ornullif the type is not known or cannot be determined.Returns the (repository) extension of this artifact. eg: ".jsp"Returns the relative path of this artifact in platform format including the extension. eg: "_cq_nodeType.cnd" or "en/.content.xml" and eventual intermediate extensions. eg: "image.png.dir/.content.xml"Returns the relative (repository) path of this artifact in respect to it's parent node. eg: "myNodeType"getType()Returns the type of this artifact.inthashCode()protected voidsetContentType(String contentType) Sets the content typevoidspool(OutputStream out) Writes the content to the given output stream.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jackrabbit.vault.fs.api.Artifact
getContentLength, getInputSource, getInputStream, getLastModified, getPreferredAccess, getSerializationType
-
Constructor Details
-
AbstractArtifact
protected AbstractArtifact(Artifact parent, String repoRelPath, String extension, ArtifactType type) Creates a new abstract artifact with the given repository name, platform extension and and type. the parent artifact is only used for generating the paths and is not linked to this artifact.- Parameters:
parent- the parent artifact ornull.repoRelPath- the repository nameextension- the platform extensiontype- type of the artifact
-
AbstractArtifact
Creates a new abstract artifact initialized with the values from the given one.- Parameters:
base- base artifacttype- the new type
-
-
Method Details
-
getRelativePath
Returns the relative (repository) path of this artifact in respect to it's parent node. eg: "myNodeType"- Specified by:
getRelativePathin interfaceArtifact- Returns:
- the final name
-
getPlatformPath
Returns the relative path of this artifact in platform format including the extension. eg: "_cq_nodeType.cnd" or "en/.content.xml" and eventual intermediate extensions. eg: "image.png.dir/.content.xml"- Specified by:
getPlatformPathin interfaceArtifact- Returns:
- the relative platform path
-
getExtension
Returns the (repository) extension of this artifact. eg: ".jsp"- Specified by:
getExtensionin interfaceArtifact- Returns:
- the (repository) extension of this artifact.
-
getType
Returns the type of this artifact. -
spool
Writes the content to the given output stream. This is the preferred method to use for output-artifacts.The specified stream remains open after this method returns. Provides a generic spool mechanism from the
Artifact.getInputStream()to the provided output stream.- Specified by:
spoolin interfaceArtifact- Parameters:
out- the output stream to spool to- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs
-
toString
-
getContentType
Returns the content type of the serialized data ornullif the type is not known or cannot be determined.- Specified by:
getContentTypein interfaceArtifact- Returns:
- the content type or
null.
-
setContentType
Sets the content type- Parameters:
contentType- the content type
-
hashCode
public int hashCode() -
equals
-
dump
Dumps some human readable information using the given context.
-