Package com.uc4.communication.requests
Class DownloadBinary
java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.DownloadBinary
Downloads a file from a STORE object.
-
Constructor Summary
ConstructorsConstructorDescriptionDownloadBinary(UC4ObjectName storeObject, String entryName, PlatformSwHwType platformSwHw) Creates a new request to download a file from a STORE object.DownloadBinary(UC4ObjectName storeObject, String entryName, PlatformSwHwType platformSwHw, File outputFile) Creates a new request to download a file from a STORE object.DownloadBinary(UC4ObjectName storeObject, String entryName, PlatformSwHwType platformSwHw, File outputFile, String resname) Creates a new request to download a file from a STORE object.DownloadBinary(UC4ObjectName storeObject, String entryName, PlatformSwHwType platformSwHw, String resname) Creates a new request to download a file from STORE object. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.automic.protocol.MessagecreateNATRequest(ConnectionAttributes sessionInfo) Sub classes may override this method send messages in NAT protocol to the AE.protected voidcreateRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo) Creates the XML Document for the request.Returns the file as ByteBuffer.Returns the content of a text file.getContentAsText(String lineSeparator) Returns the content of a text file using a specified line line seperator.Returns theExceptionthat occured during the writing of the outputfile ornullif it was successful.Returns the resource name which was set, or null if it was not set.protected StringgetSrc()Returns the request source.protected voidhandleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session) Sub classes extract the values from the XML document and provide public getter methods.booleanisBinary()Returns true if the file is a binary and not a text file.booleanReturnstrueif the outputfile was saved successfully.booleanisText()Returns true if the resource is a text.Methods inherited from class com.uc4.communication.requests.XMLRequest
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, ignoreMessageBox, isAllowedInClientZero, send, setMessageBox, showQuarantineNotification
-
Constructor Details
-
DownloadBinary
Creates a new request to download a file from a STORE object.- Parameters:
storeObject- Name of the STORE objectentryName- 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, String entryName, PlatformSwHwType platformSwHw, File outputFile) Creates a new request to download a file from a STORE object.- Parameters:
storeObject- Name of the STORE objectentryName- 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, String entryName, PlatformSwHwType platformSwHw, String resname) Creates a new request to download a file from STORE object.- Parameters:
storeObject- Name of the STORE objectentryName- 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, String entryName, PlatformSwHwType platformSwHw, File outputFile, String resname) Creates a new request to download a file from a STORE object.- Parameters:
storeObject- Name of the STORE objectentryName- 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 Details
-
getSrc
Description copied from class:XMLRequestReturns the request source. This method is used internally.- Specified by:
getSrcin classXMLRequest- Returns:
- Source
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo) Description copied from class:XMLRequestCreates the XML Document for the request. This method is used internally.- Specified by:
createRequestin classXMLRequest- Parameters:
doc- Document, used to create new Elementsrequest- Request Element - classes append information to this request elementsessionInfo- Information about the session
-
createNATRequest
Description copied from class:XMLRequestSub classes may override this method send messages in NAT protocol to the AE.- Overrides:
createNATRequestin classXMLRequest- Parameters:
sessionInfo- Session infos- Returns:
- Message or null if not used
-
handleContent
Description copied from class:XMLRequestSub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContentin classXMLRequest- Parameters:
doc- XML Documentsession- 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
Returns the file as ByteBuffer.- Returns:
- file content
-
getContentAsText
Returns the content of a text file. This method should only be called ifisText()returnstrue. The default line seperator is used.- Returns:
- String containing the file content
-
getContentAsText
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()Returnstrueif the outputfile was saved successfully. If this method returnsfalsethe methodgetFileIOExceptioncan be used to get the exception which occured during the writing of the outputfile.- Returns:
- True if the outputfile was saved successfully.
-
getFileIOException
Returns theExceptionthat occured during the writing of the outputfile ornullif it was successful.- Returns:
- IOException or null
-
getResourceName
Returns the resource name which was set, or null if it was not set.- Returns:
- resname or null;
-