Package org.kissweb.restServer
Class ProcessServlet
java.lang.Object
org.kissweb.restServer.ProcessServlet
- All Implemented Interfaces:
Runnable
Author: Blake McBride
Date: 11/26/19
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the absolute path of the root of the back-end application.Returns the IP address of the client.javax.servlet.http.HttpServletRequest
Returns the HttpServletRequest.javax.servlet.ServletContext
Returns the ServletContext.getUploadBufferedInputStream
(int i) In file upload scenarios, this method returns a BufferedInputStream associated with file number i.byte[]
getUploadBytes
(int i) In a file upload scenario, this method returns a byte array of the data that was uploaded.int
Return the number of files being uploaded.getUploadFileName
(int i) Returns the name of the file being uploaded.getUploadFileType
(int i) Returns the file extension of a given file upload.Get all user data.getUserData
(String key) Get a specific user data element.void
returnBinary
(byte[] data) Return binary data to the front-end.void
run()
saveUploadFile
(int n) Reads upload file "n", saves it to a temporary file, and returns the path to that file.saveUploadFile
(int n, String fileName) Reads upload file "n", saves it to the file name passed in, and returns the file name passed in
-
Field Details
-
DB
-
-
Method Details
-
run
public void run() -
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. -
getUploadFileName
Returns the name of the file being uploaded.- Parameters:
i
- beginning at 0- See Also:
-
getUploadFileType
Returns the file extension of a given file upload.- Parameters:
i
-- Returns:
-
getUploadBufferedInputStream
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
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
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
Reads upload file "n", saves it to the file name passed in, and returns the file name passed in- Parameters:
n
- file numberfileName
- 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
Get all user data.- Returns:
-
getUserData
Get a specific user data element.- Parameters:
key
-- Returns:
-
getRemoteAddr
Returns the IP address of the client.- Returns:
-