Class ProcessServlet

java.lang.Object
org.kissweb.restServer.ProcessServlet
All Implemented Interfaces:
Runnable

public class ProcessServlet extends Object implements Runnable
Author: Blake McBride Date: 11/26/19
  • Field Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getRealPath

      public String getRealPath()
      Get the absolute path of the root of the back-end application.
    • getServletContext

      public javax.servlet.ServletContext getServletContext()
      Returns the ServletContext.
    • getRequest

      public javax.servlet.http.HttpServletRequest getRequest()
      Returns the HttpServletRequest.
    • getUploadFileCount

      public int getUploadFileCount()
      Return the number of files being uploaded.
      See Also:
    • getUploadFileName

      public String getUploadFileName(int i)
      Returns the name of the file being uploaded.
      Parameters:
      i - beginning at 0
      See Also:
    • getUploadFileType

      public String getUploadFileType(int i)
      Returns the file extension of a given file upload.
      Parameters:
      i -
      Returns:
    • getUploadBufferedInputStream

      public BufferedInputStream getUploadBufferedInputStream(int i)
      In file upload scenarios, this method returns a BufferedInputStream associated with file number i. When done, the stream must be closed by the application.
      Parameters:
      i - starting from 0
      See Also:
    • getUploadBytes

      public byte[] getUploadBytes(int i) throws IOException
      In a file upload scenario, this method returns a byte array of the data that was uploaded.
      Parameters:
      i - starting from 0
      Returns:
      Throws:
      IOException
    • saveUploadFile

      public String saveUploadFile(int n) throws IOException
      Reads upload file "n", saves it to a temporary file, and returns the path to that file.
      Parameters:
      n - file number
      Returns:
      Throws:
      IOException
      See Also:
    • saveUploadFile

      public String saveUploadFile(int n, String fileName) throws IOException
      Reads upload file "n", saves it to the file name passed in, and returns the file name passed in
      Parameters:
      n - file number
      fileName - the name of the file to save the upload to
      Returns:
      the fileName passed in
      Throws:
      IOException
      See Also:
    • returnBinary

      public void returnBinary(byte[] data)
      Return binary data to the front-end.
      Parameters:
      data -
    • getUserData

      public UserData getUserData()
      Get all user data.
      Returns:
    • getUserData

      public Object getUserData(String key)
      Get a specific user data element.
      Parameters:
      key -
      Returns:
    • getRemoteAddr

      public String getRemoteAddr()
      Returns the IP address of the client.
      Returns: