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.
  • Constructor Details

    • UploadThread

      public UploadThread()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setParams

      public void setParams(String type, int length, InputStream is)
      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 by getFileContent().
      Parameters:
      type - The type of the request, can be determined by the request.getContentType() function.
      length - The length of the request, can be determined by the request.getContentLength() function.
      is - The inputstream of the request, can be determined by the request.getInputStream() function.
    • setParams

      public 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. 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 the request.getContentType() method.
      length - The length of the request, can be determined by the request.getContentLength() method.
      is - The inputstream of the request, can be determined by the request.getInputStream() method.
      dir - The directory of the server in which the file will be saved with its original name.
    • setParams

      public 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. Calling this the file selected on the client side will be saved on the server side as savedFileName.
      Parameters:
      type - The type of the request, can be determined by the request.getContentType() funtion.
      length - The length of the request, can be determined by the request.getContentLength() funtion.
      is - The inputstream of the request, can be determined by the request.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 the dir directory.
    • getFileContent

      public String 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

      public String 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

      public 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

      public String 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

      public Enumeration<String> 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

      public String 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.
      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 returns false.
    • 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.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • 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

      public Exception 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.