Class JDFFileSpec

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, IStreamWriter, IURLSetter, org.w3c.dom.Element, org.w3c.dom.ElementTraversal, org.w3c.dom.events.EventTarget, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.TypeInfo

    public class JDFFileSpec
    extends JDFAutoFileSpec
    implements IURLSetter
    See Also:
    Serialized Form
    • Constructor Detail

      • JDFFileSpec

        public JDFFileSpec​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                           java.lang.String qualifiedName)
                    throws org.w3c.dom.DOMException
        Constructor for JDFFileSpec
        Parameters:
        myOwnerDocument -
        qualifiedName -
        Throws:
        org.w3c.dom.DOMException
      • JDFFileSpec

        public JDFFileSpec​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                           java.lang.String myNamespaceURI,
                           java.lang.String qualifiedName)
                    throws org.w3c.dom.DOMException
        Constructor for JDFFileSpec
        Parameters:
        myOwnerDocument -
        myNamespaceURI -
        qualifiedName -
        Throws:
        org.w3c.dom.DOMException
      • JDFFileSpec

        public JDFFileSpec​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                           java.lang.String myNamespaceURI,
                           java.lang.String qualifiedName,
                           java.lang.String myLocalName)
                    throws org.w3c.dom.DOMException
        Constructor for JDFFileSpec
        Parameters:
        myOwnerDocument -
        myNamespaceURI -
        qualifiedName -
        myLocalName -
        Throws:
        org.w3c.dom.DOMException
    • Method Detail

      • toString

        public java.lang.String toString()
        Description copied from class: KElement
        this to string, used for debug purpose mostly
        Overrides:
        toString in class KElement
        Returns:
        string representativ of this
        See Also:
        KElement.toString()
      • setAbsoluteFileURL

        public void setAbsoluteFileURL​(java.io.File f,
                                       boolean bEscape128)
        sets the URL attribute to an absolute file IRL (internationalized)
        Parameters:
        f - the file to set the URL to
        bEscape128 - if true, escape chars>128 (URL) else don't escape (IRL)
      • setRelativeURL

        public void setRelativeURL​(java.io.File f,
                                   java.io.File baseDir,
                                   boolean bEscape128)
        sets the URL attribute to an absolute file IRL (internationalized)
        Parameters:
        f - the file to set the URL to
        baseDir - the File representing the relative location. if null use current working dir
        bEscape128 - if true, escape chars>128 (URL) else don't escape (IRL)
      • getURLInputStream

        public java.io.InputStream getURLInputStream()
        get the input stream that reads from URL
        Specified by:
        getURLInputStream in interface IURLSetter
        Returns:
        InputStream the input stream that the url points to, null if the url is inaccessible
      • setMimeURL

        public void setMimeURL​(java.lang.String url)
        sets URL and MimeType by matching the extensions
        Parameters:
        url - the url to set URL
      • moveToDir

        @Deprecated
        public java.io.File moveToDir​(java.io.File dir)
        Deprecated.
        use URLUTil.moveToDir(this)
        physically store the file at the location specified in dir and also modify this to reflect the new location
        Parameters:
        dir -
        Returns:
        the file that corresponds to the moved url reference, null if an error occurred
      • getFileName

        public java.lang.String getFileName()
        returns the filename of the referenced object, even if it is a cid or http url
        Returns:
        the file name of the referenced object
      • getMimeTypeFromURL

        @Deprecated
        public static java.lang.String getMimeTypeFromURL​(java.lang.String url)
        Deprecated.
        use @see UrlUtil.getMimeTypeFromURL(url)
        generates the correct MIMEType for a given URL and sets it
        Parameters:
        url -
        Returns:
      • setContainer

        public JDFFileSpec setContainer​(java.lang.String containerUrl,
                                        java.lang.String mimeType)
        create a container and prefill a filespec
        Parameters:
        containerUrl -
        mimeType -
        Returns:
        the Container/FileSpec
      • setFileSize

        public void setFileSize​(long value)
        (36) set attribute FileSize
        Parameters:
        value - the value to set the attribute to
      • getFileSizeLong

        public long getFileSizeLong()
        Returns:
        the value of FileSize