Class BodypartFTBP
This kind of bodypart is used to preserve attributes like the file name, the size, creation time, modification time, file permission, etc.
Note that the dates returned by the get() method, and those expected by set() methods are
in UTC Time format. This encodes it as YYMMDDHHMMSSzone.
For example, 2 October 2008, at 15:37:41 GMT is 081002153741Z.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.isode.x400.highlevel.Bodypart
Bodypart.Bodypart_Type -
Field Summary
Fields inherited from class com.isode.x400.highlevel.Bodypart
bodypart_size, bodypart_type -
Constructor Summary
ConstructorsConstructorDescriptionBodypartFTBP(BodyPart bp_obj) Constructor based on an existing bodypart object, for example, one read from an existing message.BodypartFTBP(String filename) Create a new File Transfer bodypart, with only the binary data taken from the file provided by the filename.BodypartFTBP(String filename, boolean set_common_attributes) Create a new File Transfer bodypart, optionally setting all the common attributes with information taken from the file itself.BodypartFTBP(String filename, byte[] ftbp_data) Create a new File Transfer bodypart, with the binary data provided (in memory) and the filename. -
Method Summary
Modifier and TypeMethodDescriptionReturns the application reference OID of the File Transfer Body Part The value is a dotted decimal value.Returns the application reference of the File Transfer Body Part, as a Stringbyte[]Returns the data of the File Transfer Body Part as an array of bytesReturns the content description of the File Transfer Body PartReturns the creation date of the File Transfer Body Part, encoded as a UTC time stringReturns the name of the file attribute of the File Transfer Body PartReturns the modification date of the File Transfer Body Part, encoded as a UTC time stringReturns the read date of the File Transfer Body Part, encoded as a UTC time stringintgetSize()Returns the size (in bytes) of the file in the File Transfer Body Part, or -1 if the size cannot be calculated.Returns the string of the File Transfer bodypart.voidsaveFTBPInDir(String outputDir) Save the FTBP in the specified directory, the file name will be the one specified in the actual bodypartvoidsetApplicationReference(String appRefStr) Set the application reference of the File Transfer Body PartvoidsetApplicationReferenceOID(String appRefOID) Set the application reference OID of the File Transfer Body Part The value is a dotted decimal value.voidsetBodyData(byte[] data) Set the data of the File Transfer Body Part as an array of bytesvoidsetContentDescription(String description) Set the content description of the File Transfer Body PartvoidSet the creation date of the File Transfer Body Part, encoded as a UTC time stringvoidsetFileName(String filename) Set the name of the file attribute of the File Transfer Body PartvoidsetFTBPSize(int size) Set the size (in bytes) of the FTBPvoidSet the modification date of the File Transfer Body PartvoidsetReadDate(String rd) Set the read date of the File Transfer Body Part, encoded as a UTC time stringMethods inherited from class com.isode.x400.highlevel.Bodypart
getBodypartObject, getByteParam, getIntParam, getStringParam, getType, getTypeAsString, saveBP, setByteParam, setIntParam, setSize, setStringParam
-
Constructor Details
-
BodypartFTBP
Constructor based on an existing bodypart object, for example, one read from an existing message.- Parameters:
bp_obj-- Throws:
X400APIException
-
BodypartFTBP
Create a new File Transfer bodypart, with only the binary data taken from the file provided by the filename.All the other attributes, like file name, modification date, etc, can be added independently after.
Alternatively, you can use the BodypartFTBP(filename, true) method to set the standard values automatically.
- Throws:
X400APIException
-
BodypartFTBP
Create a new File Transfer bodypart, optionally setting all the common attributes with information taken from the file itself.- Parameters:
filename- Full path name to the file to use as a bodypartset_common_attributes- If true, set the file name, file size and encoding- Throws:
X400APIException
-
BodypartFTBP
Create a new File Transfer bodypart, with the binary data provided (in memory) and the filename. This method can be used when the data is already held in memory, and there's no file in the file system corresponding to "filename".All the other attributes, like modification date, etc, can be added independently after.
Alternatively, if the file name exists, you can use the BodypartFTBP(filename, true) method to set the standard values automatically.
- Throws:
X400APIException
-
-
Method Details
-
setFTBPSize
Set the size (in bytes) of the FTBP- Parameters:
size- The size, in bytes, of the file- Throws:
X400APIException
-
getSize
public int getSize()Returns the size (in bytes) of the file in the File Transfer Body Part, or -1 if the size cannot be calculated. -
setFileName
Set the name of the file attribute of the File Transfer Body Part- Parameters:
filename- Name of the file (doesn't have to contain the full path)- Throws:
X400APIException
-
getFileName
Returns the name of the file attribute of the File Transfer Body Part- Throws:
X400APIException
-
getStringRepresentation
Returns the string of the File Transfer bodypart.The format of this string is suitable for informing the user about the forwarded message bodypart, but does not contain all the information.
-
setApplicationReference
Set the application reference of the File Transfer Body Part- Parameters:
appRefStr- application reference string- Throws:
X400APIException
-
getApplicationReferenceString
Returns the application reference of the File Transfer Body Part, as a String- Throws:
X400APIException
-
setApplicationReferenceOID
Set the application reference OID of the File Transfer Body Part The value is a dotted decimal value.For example: the value "2.16.840.1.113694.2.2.1.1" corresponds to ID value registered by the Electronic Messaging Association (EMA) to represent the abstract-value 'generic-binary-attachment'
- Parameters:
appRefOID- application reference OID- Throws:
X400APIException
-
getApplicationReferenceOID
Returns the application reference OID of the File Transfer Body Part The value is a dotted decimal value.For example: the value "2.16.840.1.113694.2.2.1.1" corresponds to ID value registered by the Electronic Messaging Association (EMA) to represent the abstract-value 'generic-binary-attachment'
- Throws:
X400APIException
-
setContentDescription
Set the content description of the File Transfer Body Part- Parameters:
description- description- Throws:
X400APIException
-
getContentDescription
Returns the content description of the File Transfer Body Part- Throws:
X400APIException
-
setModificationDate
Set the modification date of the File Transfer Body Part- Parameters:
md- the file's modification date, encoded as a UTC time string- Throws:
X400APIException
-
getModificationDate
Returns the modification date of the File Transfer Body Part, encoded as a UTC time string- Throws:
X400APIException
-
setCreationDate
Set the creation date of the File Transfer Body Part, encoded as a UTC time string- Parameters:
cd- creation date- Throws:
X400APIException
-
getCreationDate
Returns the creation date of the File Transfer Body Part, encoded as a UTC time string- Throws:
X400APIException
-
setReadDate
Set the read date of the File Transfer Body Part, encoded as a UTC time string- Parameters:
rd- read date- Throws:
X400APIException
-
getReadDate
Returns the read date of the File Transfer Body Part, encoded as a UTC time string- Throws:
X400APIException
-
setBodyData
Set the data of the File Transfer Body Part as an array of bytes- Parameters:
data- Data to use for the FTBP- Throws:
X400APIException
-
getBodyData
Returns the data of the File Transfer Body Part as an array of bytes- Throws:
X400APIException
-
saveFTBPInDir
Save the FTBP in the specified directory, the file name will be the one specified in the actual bodypart- Parameters:
outputDir-- Throws:
X400APIException
-