Class AdminUploadServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
sk.iway.iwcm.admin.upload.AdminUploadServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

@WebServlet("/admin/upload/chunk") public class AdminUploadServlet extends javax.servlet.http.HttpServlet
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Zmaze docasny subor (ak napr.
    protected void
    doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    static String
    Return original file name.
    static String
    Vrati cestu k temp suboru, pozuiva sa vo FormMail na detekciu ci subor vyhovuje poziadavkam
    static String
    moveAndReplaceFile(String fileKey, String destinationFolder, String fileNameParam)
    Presunie uploadnuty subor z docasneho umiestnenia do cieloveho adresara

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdminUploadServlet

      public AdminUploadServlet()
  • Method Details

    • doPost

      protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Overrides:
      doPost in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • 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

      public static boolean deleteTempFile(String fileKey)
      Zmaze docasny subor (ak napr. user klikol na moznost neprepisat subor)
      Parameters:
      fileKey -
      Returns:
      - true ak subor existoval a zmazal sa
    • getTempFilePath

      public static String getTempFilePath(String fileKey)
      Vrati cestu k temp suboru, pozuiva sa vo FormMail na detekciu ci subor vyhovuje poziadavkam
      Parameters:
      fileKey -
      Returns:
    • getOriginalFileName

      public static String getOriginalFileName(String fileKey)
      Return original file name. If file is not found, return null.
      Parameters:
      fileKey -
      Returns: