|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
wjhk.jupload2.upload.DefaultFileUploadThread
wjhk.jupload2.upload.FileUploadThreadHTTP
public class FileUploadThreadHTTP
This class implements the file upload via HTTP POST request.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class wjhk.jupload2.upload.DefaultFileUploadThread |
|---|
filesToUpload, maxChunkSize, nbMaxFilesPerUpload, responseBody, responseMsg, stop, uploadException, uploadPolicy |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
FileUploadThreadHTTP(FileData[] filesDataParam,
UploadPolicy uploadPolicy,
JProgressBar progress)
Creates a new instance. |
|
| Method Summary | |
|---|---|
(package private) void |
afterFile(int index)
Idem as DefaultFileUploadThread.beforeFile(int), but is called after each file (and
each chunks for each file). |
(package private) void |
beforeFile(int index)
This method is called before sending the bytes corresponding to the file whose index is given in argument. |
(package private) void |
beforeRequest(int firstFileToUploadParam,
int nbFilesToUploadParam)
This method is called before starting of each request. |
(package private) void |
cleanAll()
Clean any used resource, like a 'permanent' connection. |
(package private) void |
cleanRequest()
Clean any used resource of the last executed request. |
(package private) int |
finishRequest()
This method is called at the end of each request. |
(package private) long |
getAdditionnalBytesForUpload(int index)
This methods upload overhead for the file number indexFile in the filesDataParam given to the constructor. |
(package private) OutputStream |
getOutputStream()
Get the output stream where the files should be written for upload. |
(package private) void |
startRequest(long contentLength,
boolean bChunkEnabled,
int chunkPart,
boolean bLastChunk)
This method is called for each upload request to the server. |
void |
stopUpload()
Stopping the Thread |
| Methods inherited from class wjhk.jupload2.upload.DefaultFileUploadThread |
|---|
close, getException, getResponseBody, getResponseMsg, getStartTime, getTotalLength, getUploadedLength, isUploadStopped, nbBytesUploaded, normalizeCRLF, quoteCRLF, run, setResponseBody, setResponseMsg |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface wjhk.jupload2.upload.FileUploadThread |
|---|
isAlive, join, join, start |
| Constructor Detail |
|---|
public FileUploadThreadHTTP(FileData[] filesDataParam,
UploadPolicy uploadPolicy,
JProgressBar progress)
filesDataParam - The files to upload.uploadPolicy - The policy to be applied.progress - The progress bar to be updated.| Method Detail |
|---|
void beforeRequest(int firstFileToUploadParam,
int nbFilesToUploadParam)
throws JUploadException
DefaultFileUploadThread
beforeRequest in class DefaultFileUploadThreadJUploadExceptionDefaultFileUploadThread.beforeRequest(int, int)
long getAdditionnalBytesForUpload(int index)
throws JUploadIOException
DefaultFileUploadThread
getAdditionnalBytesForUpload in class DefaultFileUploadThreadindex - The index of the file in the filesDataParam array, whose
addtional length is asked.
JUploadIOExceptionDefaultFileUploadThread.getAdditionnalBytesForUpload(int)
void afterFile(int index)
throws JUploadIOException
DefaultFileUploadThreadDefaultFileUploadThread.beforeFile(int), but is called after each file (and
each chunks for each file).
afterFile in class DefaultFileUploadThreadindex - The index of the file that was just sent.
JUploadIOExceptionDefaultFileUploadThread.afterFile(int)
void beforeFile(int index)
throws JUploadException
DefaultFileUploadThread
beforeFile in class DefaultFileUploadThreadindex - The index of the file that will be sent just after
JUploadExceptionDefaultFileUploadThread.beforeFile(int)
void cleanAll()
throws JUploadException
DefaultFileUploadThread
cleanAll in class DefaultFileUploadThreadJUploadExceptionDefaultFileUploadThread.cleanAll()
void cleanRequest()
throws JUploadException
DefaultFileUploadThread
cleanRequest in class DefaultFileUploadThreadJUploadExceptionDefaultFileUploadThread.cleanRequest()
int finishRequest()
throws JUploadException
DefaultFileUploadThread
finishRequest in class DefaultFileUploadThreadJUploadExceptionDefaultFileUploadThread.startRequest(long, boolean, int, boolean)
OutputStream getOutputStream()
throws JUploadException
DefaultFileUploadThread
getOutputStream in class DefaultFileUploadThreadJUploadExceptionDefaultFileUploadThread.getOutputStream()
void startRequest(long contentLength,
boolean bChunkEnabled,
int chunkPart,
boolean bLastChunk)
throws JUploadException
DefaultFileUploadThreadDefaultFileUploadThread.getOutputStream() methods
is then called to know where the uploaded files should be written.
startRequest in class DefaultFileUploadThreadcontentLength - The total number of bytes for the files (or the
chunk) to upload in this query.bChunkEnabled - True if this upload is part of a file (can occurs
only if the maxChunkSize applet parameter is set). False
otherwise.chunkPart - The chunk number. Should be ignored if bChunkEnabled is
false.bLastChunk - True if in chunk mode, and this upload is the last one.
Should be ignored if bChunkEnabled is false.
JUploadExceptionDefaultFileUploadThread.startRequest(long, boolean, int, boolean)public void stopUpload()
FileUploadThread
stopUpload in interface FileUploadThreadstopUpload in class DefaultFileUploadThreadFileUploadThread.stopUpload()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||