|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UploadDownloadMgr
Manages uploading or downloading of files to/from the server. Generally for internal use only.
Field Summary | |
---|---|
static 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, JMX_DOMAIN, NAME_KEY, NO_NAME, NOTIFICATION_PREFIX, NULL_NAME |
Method Summary | |
---|---|
byte[] |
downloadBytes(Object downloadID,
int requestSize)
Download bytes from the server using the downloadID obtained from initiateDownload(). |
long |
getDownloadLength(Object downloadID)
Get the total length the download will be, in bytes. |
int |
getMaxDownloadChunkSize()
|
Object |
initiateDownload(File theFile,
boolean deleteWhenDone)
Initiates a file download with the given filename. |
Object |
initiateUpload(String name,
long totalSize)
Initiate an upload operation. |
File |
takeUpload(Object uploadID)
Ownership of transferred bytes (now in a File) are transferred to the caller. |
boolean |
uploadBytes(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, isDAS |
Methods inherited from interface javax.management.NotificationEmitter |
---|
removeNotificationListener |
Methods inherited from interface javax.management.NotificationBroadcaster |
---|
addNotificationListener, getNotificationInfo, removeNotificationListener |
Methods inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
---|
getMBeanLoggerName, getMBeanLogLevel, setMBeanLogLevel |
Field Detail |
---|
static final String J2EE_TYPE
AMX.getJ2EEType()
.
Method Detail |
---|
Object initiateUpload(String name, long totalSize) throws IOException
name
- name to use for the temp file, may be nulltotalSize
- total size of the file to upload
IOException
boolean uploadBytes(Object uploadID, byte[] bytes) throws IOException
uploadID
- the id obtained from initiateUpload()bytes
- more bytes to be uploaded
an
- Exception if a problem occurred
IOException
File takeUpload(Object uploadID)
uploadID
- the id obtained from initiateUpload()
an
- Exception if the uploadID doesn't exist, or has not finished.Object initiateDownload(File theFile, boolean deleteWhenDone) throws IOException
theFile
- an accessible FiledeleteWhenDone
- whether to delete the file when done
IOException
long getDownloadLength(Object downloadID)
downloadID
- the dowloadID, as obtained from initiateDownload()int getMaxDownloadChunkSize()
byte[] downloadBytes(Object downloadID, int requestSize) throws 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()
IOException
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.