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 |
---|---|
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. |
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.
|
getMessageBox, getRequestID, handleResponse, send
public 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 contentpublic 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()
String
public 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()