public class UploadBinary extends XMLRequest
| Modifier and Type | Class and Description |
|---|---|
static class |
UploadBinary.ContentType
Content-type of the file (BINARY, TEXT,...).
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_UPLOAD_SIZE
Max file size in bytes for uploads.
|
| Constructor and Description |
|---|
UploadBinary(UC4ObjectName storeObject,
java.lang.String entryName,
PlatformSwHwType osPlatformHw,
boolean isUpdate,
java.nio.ByteBuffer buffer)
Creates a new request to upload a file to a STORE object.
|
UploadBinary(UC4ObjectName storeObject,
java.lang.String entryName,
PlatformSwHwType osPlatformHw,
boolean isUpdate,
java.io.File inputFile)
Creates a new request to upload a file to a STORE object.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.automic.protocol.Message |
createNATRequest(ConnectionAttributes sessionInfo)
Sub classes may override this method send messages in NAT protocol to the AE.
|
protected void |
createRequest(com.uc4.util.XMLDocument doc,
org.w3c.dom.Element request,
ConnectionAttributes sessionInfo)
Creates the XML Document for the request.
|
long |
getContentLen()
Returns the length of the upload-content.
|
java.lang.String |
getEntryName()
Return the entryName used for the Data to transfer.
|
java.lang.Exception |
getFileException()
Returns the
Exception that occured during the reading of the inputFile or null
if it was successful. |
protected java.lang.String |
getSrc()
Returns the request source.
|
protected void |
handleContent(com.uc4.util.XMLDocument doc,
ConnectionAttributes session) |
protected boolean |
ignoreMessageBox() |
protected boolean |
isAllowedInClientZero()
This method is used internally.
|
boolean |
isFileUploadOK()
Returns
true if the inputFile was uploaded successfully. |
void |
setContentType(UploadBinary.ContentType contentType)
Sets the content type.
|
void |
setFileName(java.lang.String fileName)
Set the resource file name.
|
void |
setVersion(java.lang.String version)
Set the resource version.
|
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, send, setMessageBox, showQuarantineNotificationpublic static final int MAX_UPLOAD_SIZE
public UploadBinary(UC4ObjectName storeObject, java.lang.String entryName, PlatformSwHwType osPlatformHw, boolean isUpdate, java.io.File inputFile)
storeObject - Name of the STORE object.entryName - Name of the entry in the STORE objectosPlatformHw - Combined type of OS, Platform, HW of the entry.isUpdate - Must be set to true if a resource should be updated.inputFile - File which should be uploadedpublic UploadBinary(UC4ObjectName storeObject, java.lang.String entryName, PlatformSwHwType osPlatformHw, boolean isUpdate, java.nio.ByteBuffer buffer)
storeObject - Name of the STORE objectentryName - Name of the entry which is used to identify the file.osPlatformHw - Combined type of OS, Platform, HW of the entry.isUpdate - Must be set to true if a resource should be updated.buffer - File contentprotected com.automic.protocol.Message createNATRequest(ConnectionAttributes sessionInfo)
XMLRequestcreateNATRequest in class XMLRequestsessionInfo - Session infosprotected boolean isAllowedInClientZero()
XMLRequestXMLRequest is allowed in client 0.
The default implementation returns false, subclasses may override.isAllowedInClientZero in class XMLRequesttrue if this request is allowed in client 0, false otherwiseprotected java.lang.String getSrc()
XMLRequestgetSrc in class XMLRequestprotected void createRequest(com.uc4.util.XMLDocument doc,
org.w3c.dom.Element request,
ConnectionAttributes sessionInfo)
XMLRequestcreateRequest in class XMLRequestdoc - Document, used to create new Elementsrequest - Request Element - classes append information to this request elementsessionInfo - Information about the sessionpublic void setVersion(java.lang.String version)
version - Versionpublic void setFileName(java.lang.String fileName)
fileName - Name of the filepublic void setContentType(UploadBinary.ContentType contentType)
contentType - content-type of the filepublic java.lang.String getEntryName()
Stringpublic boolean isFileUploadOK()
true if the inputFile was uploaded successfully.
If this method returns false there are two possible error-sources:
public java.lang.Exception getFileException()
Exception that occured during the reading of the inputFile or null
if it was successful.public long getContentLen()
protected boolean ignoreMessageBox()
ignoreMessageBox in class XMLRequestprotected void handleContent(com.uc4.util.XMLDocument doc,
ConnectionAttributes session)
handleContent in class XMLRequest