Class PropertyValueArtifact

    • Constructor Detail

      • PropertyValueArtifact

        public PropertyValueArtifact​(Artifact parent,
                                     String relPath,
                                     String ext,
                                     ArtifactType type,
                                     javax.jcr.Property prop,
                                     long lastModified)
                              throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • PropertyValueArtifact

        public PropertyValueArtifact​(Artifact parent,
                                     String relPath,
                                     String ext,
                                     ArtifactType type,
                                     javax.jcr.Property prop,
                                     int index,
                                     long lastModified)
                              throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
    • Method Detail

      • create

        public static Collection<PropertyValueArtifact> create​(Artifact parent,
                                                               String relPath,
                                                               String ext,
                                                               ArtifactType type,
                                                               javax.jcr.Property prop,
                                                               long lastModified)
                                                        throws javax.jcr.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.
        Parameters:
        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.
        Returns:
        a collection of Artifacts.
        Throws:
        javax.jcr.RepositoryException - if an error occurs
      • getSerializationType

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

        public InputStream getInputStream()
                                   throws IOException,
                                          javax.jcr.RepositoryException
        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
        Returns:
        a input stream to the contents of this artifact.
        Throws:
        IOException - if an I/O error occurs
        javax.jcr.RepositoryException - if a repository error occurs
      • detach

        public void detach()
                    throws IOException,
                           javax.jcr.RepositoryException
        Detaches the value from the underlying property value.
        Throws:
        IOException - if an I/O error occurs
        javax.jcr.RepositoryException - if a repository error occurs.
      • getInputSource

        public VaultInputSource getInputSource()
                                        throws IOException,
                                               javax.jcr.RepositoryException
        Returns an input source to the contents of this artifact. This is also preferred for AccessType.STREAM.
        Specified by:
        getInputSource in interface Artifact
        Returns:
        a input source which systemId is the path of the underlying property
        Throws:
        IOException - if an I/O error occurs.
        javax.jcr.RepositoryException - of 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
        Returns:
        the length or -1 if the length cannot be determined.
      • getProperty

        public javax.jcr.Property getProperty()
        Returns the underlying property
        Returns:
        the underlying property
      • getLastModified

        public long getLastModified()
        Returns the last modified date or 0 if not known.
        Specified by:
        getLastModified in interface Artifact
        Returns:
        the last modified date or 0
      • 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
        Overrides:
        getContentType in class AbstractArtifact
        Returns:
        the content type or null.