|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.server.UploadedFile
This class defines a data type to hold information about a file that has been uploaded and stored in the SLAMD configuration directory.
| Field Summary | |
static java.lang.String |
ELEMENT_DATA
The name of the enocded element that holds the uploaded file data. |
static java.lang.String |
ELEMENT_DESCRIPTION
The name of the enocded element that holds the description for the uploaded file. |
static java.lang.String |
ELEMENT_NAME
The name of the enocded element that holds the name of the uploaded file. |
static java.lang.String |
ELEMENT_SIZE
The name of the enocded element that holds the size of the uploaded file. |
static java.lang.String |
ELEMENT_TYPE
The name of the enocded element that holds the type of the uploaded file. |
| Constructor Summary | |
UploadedFile(java.lang.String fileName,
java.lang.String fileType,
int fileSize,
java.lang.String fileDescription)
Creates a new uploaded file with just summary information (no actual file data). |
|
UploadedFile(java.lang.String fileName,
java.lang.String fileType,
int fileSize,
java.lang.String fileDescription,
byte[] fileData)
Creates a new uploaded file including the file data. |
|
| Method Summary | |
static UploadedFile |
decode(byte[] encodedFile)
Decodes the provided byte array as an uploaded file. |
static UploadedFile |
decodeWithoutData(byte[] encodedFile)
Decodes the provided byte array as an uploaded file, but excluding the actual file data. |
byte[] |
encode()
Encodes information about this uploaded file into a byte array. |
byte[] |
getFileData()
Retrieves the actual file data. |
java.lang.String |
getFileDescription()
Retrieves the description for the file. |
java.lang.String |
getFileName()
Retrieves the name of the uploaded file. |
int |
getFileSize()
Retrieves the size of the file in bytes. |
java.lang.String |
getFileType()
Retrieves the MIME type for the uploaded file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String ELEMENT_NAME
public static final java.lang.String ELEMENT_SIZE
public static final java.lang.String ELEMENT_TYPE
public static final java.lang.String ELEMENT_DESCRIPTION
public static final java.lang.String ELEMENT_DATA
| Constructor Detail |
public UploadedFile(java.lang.String fileName,
java.lang.String fileType,
int fileSize,
java.lang.String fileDescription)
fileName - The name of the file.fileType - The MIME type for the file.fileSize - The size of the file in bytes.fileDescription - A brief description of the file.
public UploadedFile(java.lang.String fileName,
java.lang.String fileType,
int fileSize,
java.lang.String fileDescription,
byte[] fileData)
fileName - The name of the file.fileType - The MIME type for the file.fileSize - The size of the file in bytes.fileDescription - A brief description of the file.fileData - The actual data contained in the file.| Method Detail |
public java.lang.String getFileName()
public java.lang.String getFileType()
public int getFileSize()
public java.lang.String getFileDescription()
public byte[] getFileData()
null if no file data has
been provided.public byte[] encode()
public static UploadedFile decode(byte[] encodedFile)
throws DecodeException
encodedFile - The byte array containing the deata to decode.
DecodeException - If a problem occurs while trying to decode the
provided byte array as an uploaded file.
public static UploadedFile decodeWithoutData(byte[] encodedFile)
throws DecodeException
encodedFile - The byte array containing the deata to decode.
DecodeException - If a problem occurs while trying to decode the
provided byte array as an uploaded file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||