Package chemaxon.util
Class UploadThread
java.lang.Object
java.lang.Thread
chemaxon.util.UploadThread
- All Implemented Interfaces:
Runnable
@SubjectToRemoval(date=JUL_01_2025)
@Deprecated(forRemoval=true)
@PublicApi
public class UploadThread
extends Thread
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed, no replacement.
Class for uploading a file from the client side to the server side via
HTML forms using a thread.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionint
getData()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the saved data in bytes.Deprecated, for removal: This API element is subject to removal in a future version.Returns the original name of saved file.getError()
Deprecated, for removal: This API element is subject to removal in a future version.For retrieving stored exceptions.getFile()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the file object.Deprecated, for removal: This API element is subject to removal in a future version.Returns the file content, if the selected file haven't been saved on the server side.Deprecated, for removal: This API element is subject to removal in a future version.Returns the name of saved file.int
Deprecated, for removal: This API element is subject to removal in a future version.Returns the size of saved file.getParameter
(String name) Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of parameter posted by the HTML form.Deprecated, for removal: This API element is subject to removal in a future version.Returns the names of parameters posted by the HTML form.int
Deprecated, for removal: This API element is subject to removal in a future version.Returns the rate of saved data and whole data.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Indicates if the operation was successful.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Check the current state.void
run()
Deprecated, for removal: This API element is subject to removal in a future version.Starts uploading.void
setFinished
(boolean f) Deprecated, for removal: This API element is subject to removal in a future version.Finishes the upload process.void
setParams
(String type, int length, InputStream is) Deprecated, for removal: This API element is subject to removal in a future version.Setting parameters.void
setParams
(String type, int length, InputStream is, String dir) Deprecated, for removal: This API element is subject to removal in a future version.Seting parameters.void
setParams
(String type, int length, InputStream is, String dir, String tmp) Deprecated, for removal: This API element is subject to removal in a future version.Setting the parameters.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
UploadThread
public UploadThread()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setParams
Deprecated, for removal: This API element is subject to removal in a future version.Setting parameters. Calling this the file selected on the client side will be saved in a string, won't be saved as a file. The content of the file can be obtained bygetFileContent()
.- Parameters:
type
- The type of the request, can be determined by therequest.getContentType()
function.length
- The length of the request, can be determined by therequest.getContentLength()
function.is
- The inputstream of the request, can be determined by therequest.getInputStream()
function.
-
setParams
Deprecated, for removal: This API element is subject to removal in a future version.Seting parameters. Calling this the file selected on the client side will be saved on the server side with its original name.- Parameters:
type
- The type of the request, can be determined by therequest.getContentType()
method.length
- The length of the request, can be determined by therequest.getContentLength()
method.is
- The inputstream of the request, can be determined by therequest.getInputStream()
method.dir
- The directory of the server in which the file will be saved with its original name.
-
setParams
Deprecated, for removal: This API element is subject to removal in a future version.Setting the parameters. Calling this the file selected on the client side will be saved on the server side assavedFileName
.- Parameters:
type
- The type of the request, can be determined by therequest.getContentType()
funtion.length
- The length of the request, can be determined by therequest.getContentLength()
funtion.is
- The inputstream of the request, can be determined by therequest.getInputStream()
funtion.dir
- The directory of the server in which the file will be saved.tmp
- The name of the file as which it will be saved in thedir
directory.
-
getFileContent
Deprecated, for removal: This API element is subject to removal in a future version.Returns the file content, if the selected file haven't been saved on the server side.- Returns:
- the content of the file as String
-
getData
public int getData()Deprecated, for removal: This API element is subject to removal in a future version.Returns the saved data in bytes.- Returns:
- the amount of data saved.
-
getFileName
Deprecated, for removal: This API element is subject to removal in a future version.Returns the name of saved file.- Returns:
- the name of the saved file
-
getFile
Deprecated, for removal: This API element is subject to removal in a future version.Returns the file object.- Returns:
- the file
-
getFileSize
public int getFileSize()Deprecated, for removal: This API element is subject to removal in a future version.Returns the size of saved file.- Returns:
- the size of the file
-
getDefaultFileName
Deprecated, for removal: This API element is subject to removal in a future version.Returns the original name of saved file.- Returns:
- the default file name
-
getParameterNames
Deprecated, for removal: This API element is subject to removal in a future version.Returns the names of parameters posted by the HTML form.- Returns:
- an enumeration of all parameter names
-
getParameter
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of parameter posted by the HTML form.- Parameters:
name
- Name of the parameter.- Returns:
- the parameter value
-
isFinished
public boolean isFinished()Deprecated, for removal: This API element is subject to removal in a future version.Check the current state.- Returns:
true
if uploading has finished, else returnsfalse
.
-
setFinished
public void setFinished(boolean f) Deprecated, for removal: This API element is subject to removal in a future version.Finishes the upload process.- Parameters:
f
- new value for finished
-
getPercent
public int getPercent()Deprecated, for removal: This API element is subject to removal in a future version.Returns the rate of saved data and whole data.- Returns:
- current percent
-
run
public void run()Deprecated, for removal: This API element is subject to removal in a future version.Starts uploading. -
getSuccess
public boolean getSuccess()Deprecated, for removal: This API element is subject to removal in a future version.Indicates if the operation was successful.- Returns:
true
, if the file was saved successfully
-
getError
Deprecated, for removal: This API element is subject to removal in a future version.For retrieving stored exceptions.- Returns:
- the Exception, or
null
if there were no exceptions.
-