Class AbstractArtifact

    • Constructor Detail

      • 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 or null.
        repoRelPath - the repository name
        extension - the platform extension
        type - type of the artifact
      • AbstractArtifact

        protected AbstractArtifact​(Artifact base,
                                   ArtifactType type)
        Creates a new abstract artifact initialized with the values from the given one.
        Parameters:
        base - base artifact
        type - the new type
    • Method Detail

      • getRelativePath

        public String getRelativePath()
        Returns the relative (repository) path of this artifact in respect to it's parent node. eg: "myNodeType"
        Specified by:
        getRelativePath in interface Artifact
        Returns:
        the final name
      • getPlatformPath

        public String 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:
        getPlatformPath in interface Artifact
        Returns:
        the relative platform path
      • getExtension

        public String getExtension()
        Returns the (repository) extension of this artifact. eg: ".jsp"
        Specified by:
        getExtension in interface Artifact
        Returns:
        the (repository) extension of this artifact.
      • getType

        public ArtifactType getType()
        Returns the type of this artifact.
        Specified by:
        getType in interface Artifact
        Returns:
        the type of this artifact.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        the final name and the type
      • getContentType

        public String getContentType()
        Returns the content type of the serialized data or null if the type is not known or cannot be determined.
        Specified by:
        getContentType in interface Artifact
        Returns:
        the content type or null.
      • setContentType

        protected void setContentType​(String contentType)
        Sets the content type
        Parameters:
        contentType - the content type
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • dump

        public void dump​(DumpContext ctx,
                         boolean isLast)
        Dumps some human readable information using the given context.
        Specified by:
        dump in interface Dumpable
        Parameters:
        ctx - the dump context
        isLast - specifies if this is the last element to dump on this level