Package sk.iway.iwcm.admin.upload
Class AdminUploadServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
sk.iway.iwcm.admin.upload.AdminUploadServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
@WebServlet("/admin/upload/chunk")
public class AdminUploadServlet
extends jakarta.servlet.http.HttpServlet
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandeleteTempFile(String fileKey) Zmaze docasny subor (ak napr.protected voiddoPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) static StringgetOriginalFileName(String fileKey) Return original file name.static StringgetTempFilePath(String fileKey) Vrati cestu k temp suboru, pozuiva sa vo FormMail na detekciu ci subor vyhovuje poziadavkamstatic StringmoveAndReplaceFile(String fileKey, String destinationFolder, String fileNameParam) Presunie uploadnuty subor z docasneho umiestnenia do cieloveho adresaraMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
AdminUploadServlet
public AdminUploadServlet()
-
-
Method Details
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
moveAndReplaceFile
public static String moveAndReplaceFile(String fileKey, String destinationFolder, String fileNameParam) throws IOException Presunie uploadnuty subor z docasneho umiestnenia do cieloveho adresara- Parameters:
fileKey-destinationFolder- - URL adresa cieloveho adresara, napr. /images/gallery/fileNameParam-- Returns:
- - meno suboru po presune, alebo null ak sa subor nepresunul
- Throws:
IOException
-
deleteTempFile
Zmaze docasny subor (ak napr. user klikol na moznost neprepisat subor)- Parameters:
fileKey-- Returns:
- - true ak subor existoval a zmazal sa
-
getTempFilePath
Vrati cestu k temp suboru, pozuiva sa vo FormMail na detekciu ci subor vyhovuje poziadavkam- Parameters:
fileKey-- Returns:
-
getOriginalFileName
Return original file name. If file is not found, return null.- Parameters:
fileKey-- Returns:
-