Class PropertyValueArtifact

  • All Implemented Interfaces:
    Artifact, Dumpable, ExportArtifact

    public class PropertyValueArtifact
    extends org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
    implements ExportArtifact
    Implements a artifact that is based on a property value.
    • Method Detail

      • create

        public static java.util.Collection<PropertyValueArtifact> create​(Artifact parent,
                                                                         java.lang.String relPath,
                                                                         java.lang.String ext,
                                                                         ArtifactType type,
                                                                         Property prop,
                                                                         long lastModified)
                                                                  throws RepositoryException
        Creates a collection of PropertyValueArtifact from the given property. If the property is multivalued there will be an artifact created for each value with the value index appended to it's name.
        parent - parent artifact
        relPath - the base name for the artifact(s).
        ext - the extension
        type - the type for the artifact(s).
        prop - the property for the artifact(s).
        lastModified - the last modified date.
        a collection of Artifacts.
        RepositoryException - if an error occurs
      • getSerializationType

        public SerializationType getSerializationType()
        Returns the serialization type of this artifact.
        Specified by:
        getSerializationType in interface Artifact
        the serialization type of this artifact.
      • getInputStream

        public getInputStream()
        Returns the input stream to the contents of this artifact. This is the preferred method to use for input-artifacts.
        Specified by:
        getInputStream in interface Artifact
        a input stream to the contents of this artifact.
        Throws: - if an I/O error occurs
        RepositoryException - if a repository error occurs
      • detach

        public void detach()
        Detaches the value from the underlying property value.
        Throws: - if an I/O error occurs
        RepositoryException - if a repository error occurs.
      • getContentLength

        public long getContentLength()
        Returns the length of the serialized data if it's known without doing the actual serialization.
        Specified by:
        getContentLength in interface Artifact
        the length or -1 if the length cannot be determined.
      • getProperty

        public Property getProperty()
        Returns the underlying property
        the underlying property
      • getLastModified

        public long getLastModified()
        Returns the last modified date or 0 if not known.
        Specified by:
        getLastModified in interface Artifact
        the last modified date or 0
      • getContentType

        public java.lang.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
        getContentType in class org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
        the content type or null.