Class JDFFileSpec

java.lang.Object
org.apache.xerces.dom.NodeImpl
org.apache.xerces.dom.ChildNode
org.apache.xerces.dom.ParentNode
org.apache.xerces.dom.ElementImpl
All Implemented Interfaces:
Serializable, Cloneable, IStreamWriter, IURLSetter, Element, ElementTraversal, EventTarget, Node, NodeList, TypeInfo

public class JDFFileSpec extends JDFAutoFileSpec implements IURLSetter
See Also:
  • Constructor Details

    • JDFFileSpec

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

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

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

    • toString

      public 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:
    • setAbsoluteFileURL

      public void setAbsoluteFileURL(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(File f, 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 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(String url)
      sets URL and MimeType by matching the extensions
      Parameters:
      url - the url to set URL
    • moveToDir

      @Deprecated public File moveToDir(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 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 String getMimeTypeFromURL(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(String containerUrl, 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
    • setCheckSum

      public void setCheckSum(byte[] value)
      See Also:
    • getCheckSumBytes

      public byte[] getCheckSumBytes()
      See Also:
    • setResourceUsage

      public void setResourceUsage(JDFFileSpec.EnumResourceUsage usage)
      Parameters:
      usage -
    • getResourceUsageEnum

      public JDFFileSpec.EnumResourceUsage getResourceUsageEnum()
      Returns: