|
J2EE1.4 SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Manages uploading or downloading of files to/from the server. Generally for internal use only.
Field Summary | |
static java.lang.String |
J2EE_TYPE
The j2eeType as returned by AMX.getJ2EEType() . |
Fields inherited from interface com.sun.appserv.management.base.AMX |
FULL_TYPE_DELIM, GROUP_CONFIGURATION, GROUP_JSR77, GROUP_MONITORING, GROUP_OTHER, GROUP_UTILITY, J2EE_TYPE_KEY, NAME_KEY, NO_NAME, NULL_NAME |
Fields inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
LOG_RECORD_KEY, LOG_RECORD_NOTIFICATION_TYPE |
Method Summary | |
byte[] |
downloadBytes(java.lang.Object downloadID,
int requestSize)
Download bytes from the server using the downloadID obtained from initiateDownload(). |
long |
getDownloadLength(java.lang.Object downloadID)
Get the total length the download will be, in bytes. |
int |
getMaxDownloadChunkSize()
|
java.lang.Object |
initiateDownload(java.io.File theFile,
boolean deleteWhenDone)
Initiates a file download with the given filename. |
java.lang.Object |
initiateUpload(java.lang.String name,
long totalSize)
Initiate an upload operation. |
java.io.File |
takeUpload(java.lang.Object uploadID)
Ownership of transferred bytes (now in a File) are transferred to the caller. |
boolean |
uploadBytes(java.lang.Object uploadID,
byte[] bytes)
Upload bytes for the specified upload |
Methods inherited from interface com.sun.appserv.management.base.AMX |
getContainer, getDomainRoot, getFullType, getGroup, getJ2EEType, getName |
Methods inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
getMBeanEmitLogNotifications, getMBeanLoggerName, getMBeanLogLevel, setMBeanEmitLogNotifications, setMBeanLogLevel |
Methods inherited from interface javax.management.NotificationEmitter |
removeNotificationListener |
Methods inherited from interface javax.management.NotificationBroadcaster |
addNotificationListener, getNotificationInfo, removeNotificationListener |
Field Detail |
public static final java.lang.String J2EE_TYPE
AMX.getJ2EEType()
.
Method Detail |
public java.lang.Object initiateUpload(java.lang.String name, long totalSize) throws java.io.IOException
name
- name to use for the temp file, may be nulltotalSize
- total size of the file to upload
java.io.IOException
public boolean uploadBytes(java.lang.Object uploadID, byte[] bytes) throws java.io.IOException
uploadID
- the id obtained from initiateUpload()bytes
- more bytes to be uploaded
an
- Exception if a problem occurred
java.io.IOException
public java.io.File takeUpload(java.lang.Object uploadID)
uploadID
- the id obtained from initiateUpload()
an
- Exception if the uploadID doesn't exist, or has not finished.public java.lang.Object initiateDownload(java.io.File theFile, boolean deleteWhenDone) throws java.io.IOException
theFile
- an accessible FiledeleteWhenDone
- whether to delete the file when done
java.io.IOException
public long getDownloadLength(java.lang.Object downloadID)
downloadID
- the dowloadID, as obtained from initiateDownload()public int getMaxDownloadChunkSize()
public byte[] downloadBytes(java.lang.Object downloadID, int requestSize) throws java.io.IOException
The bufferSize is the requested number of bytes to be received. If the size of the returned byte[] is less than the requestSize, then the transfer has completed, and the downloadID is no longer valid. An attempt to read more than the allowed maximum size will throw an exception. The caller can check the total download size in advance via getDownloadLength().
downloadID
- the id from initiateDownload()
java.io.IOException
|
J2EE1.4 SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2003 Sun Microsystems, Inc. All rights reserved.