Class DownloadBinary


  • public class DownloadBinary
    extends XMLRequest
    Downloads a file from a STORE object.
    • Constructor Detail

      • DownloadBinary

        public DownloadBinary​(UC4ObjectName storeObject,
                              java.lang.String entryName,
                              PlatformSwHwType platformSwHw)
        Creates a new request to download a file from a STORE object.
        Parameters:
        storeObject - Name of the STORE object
        entryName - Name of the entry which is used to identify the file.
        platformSwHw - Combined type of Platform, SW, HW of the entry.
      • DownloadBinary

        public DownloadBinary​(UC4ObjectName storeObject,
                              java.lang.String entryName,
                              PlatformSwHwType platformSwHw,
                              java.io.File outputFile)
        Creates a new request to download a file from a STORE object.
        Parameters:
        storeObject - Name of the STORE object
        entryName - Name of the entry which is used to identify the file.
        platformSwHw - Combined type of Platform, SW, HW of the entry.
        outputFile - Outputfile, where the content will be automatically be stored.
      • DownloadBinary

        public DownloadBinary​(UC4ObjectName storeObject,
                              java.lang.String entryName,
                              PlatformSwHwType platformSwHw,
                              java.lang.String resname)
        Creates a new request to download a file from STORE object.
        Parameters:
        storeObject - Name of the STORE object
        entryName - Name of the entry which is used to identify the file.
        platformSwHw - Combined type of Platform, SW, HW of the entry.
        resname - resource name of the entry which is used to identify the file.
      • DownloadBinary

        public DownloadBinary​(UC4ObjectName storeObject,
                              java.lang.String entryName,
                              PlatformSwHwType platformSwHw,
                              java.io.File outputFile,
                              java.lang.String resname)
        Creates a new request to download a file from a STORE object.
        Parameters:
        storeObject - Name of the STORE object
        entryName - Name of the entry which is used to identify the file.
        platformSwHw - Combined type of Platform, SW, HW of the entry.
        outputFile - Outputfile, where the content will be automatically be stored.
        resname - Resource name of the entry which is used to identify the file.
    • Method Detail

      • getSrc

        protected java.lang.String getSrc()
        Description copied from class: XMLRequest
        Returns the request source. This method is used internally.
        Specified by:
        getSrc in class XMLRequest
        Returns:
        Source
      • createRequest

        protected void createRequest​(com.uc4.util.XMLDocument doc,
                                     org.w3c.dom.Element request,
                                     ConnectionAttributes sessionInfo)
        Description copied from class: XMLRequest
        Creates the XML Document for the request. This method is used internally.
        Specified by:
        createRequest in class XMLRequest
        Parameters:
        doc - Document, used to create new Elements
        request - Request Element - classes append information to this request element
        sessionInfo - Information about the session
      • createNATRequest

        protected com.automic.protocol.Message createNATRequest​(ConnectionAttributes sessionInfo)
        Description copied from class: XMLRequest
        Sub classes may override this method send messages in NAT protocol to the AE.
        Overrides:
        createNATRequest in class XMLRequest
        Parameters:
        sessionInfo - Session infos
        Returns:
        Message or null if not used
      • handleContent

        protected void handleContent​(com.uc4.util.XMLDocument doc,
                                     ConnectionAttributes session)
        Description copied from class: XMLRequest
        Sub classes extract the values from the XML document and provide public getter methods.
        Overrides:
        handleContent in class XMLRequest
        Parameters:
        doc - XML Document
        session - Info about the user session
      • isText

        public boolean isText()
        Returns true if the resource is a text. The method getContentAsText() can be used.
        Returns:
        true if the file is a text file, false in case of binaries.
      • isBinary

        public boolean isBinary()
        Returns true if the file is a binary and not a text file.
        Returns:
        true if the file is not a text file.
      • getBinaryContent

        public java.nio.ByteBuffer getBinaryContent()
        Returns the file as ByteBuffer.
        Returns:
        file content
      • getContentAsText

        public java.lang.String getContentAsText()
        Returns the content of a text file. This method should only be called if isText() returns true. The default line seperator is used.
        Returns:
        String containing the file content
      • getContentAsText

        public java.lang.String getContentAsText​(java.lang.String lineSeparator)
        Returns the content of a text file using a specified line line seperator.
        Parameters:
        lineSeparator - Characters used as line seperator.
        Returns:
        Content of the text file
      • isOutputFileOK

        public boolean isOutputFileOK()
        Returns true if the outputfile was saved successfully. If this method returns false the method getFileIOException can be used to get the exception which occured during the writing of the outputfile.
        Returns:
        True if the outputfile was saved successfully.
      • getFileIOException

        public java.io.IOException getFileIOException()
        Returns the Exception that occured during the writing of the outputfile or null if it was successful.
        Returns:
        IOException or null
      • getResourceName

        public java.lang.String getResourceName()
        Returns the resource name which was set, or null if it was not set.
        Returns:
        resname or null;