Class AdminUploadController

java.lang.Object
sk.iway.iwcm.admin.upload.AdminUploadController

@RestController @RequestMapping("/admin/upload/") public class AdminUploadController extends Object
REST controller handling file upload conflict resolution (skip, overwrite, keep-both). Supports both standard file uploads and file archive uploads.
  • Constructor Details

    • AdminUploadController

      public AdminUploadController()
  • Method Details

    • skipkey

      @PostMapping(path="/skipkey", produces="application/json") public String skipkey(@RequestParam String fileKey, jakarta.servlet.http.HttpServletRequest request)
      Skips (deletes) a temporarily uploaded file identified by its key. Called when the user chooses not to overwrite an existing file.
      Parameters:
      fileKey - - unique key of the temporary uploaded file
      request - - HTTP request
      Returns:
      JSON with "success" flag
    • overwrite

      @PostMapping(path="/overwrite", produces="application/json") public String overwrite(@RequestParam String fileKey, @RequestParam String destinationFolder, @RequestParam String fileName, @RequestParam String uploadType, jakarta.servlet.http.HttpServletRequest request)
      Overwrites an existing file with the uploaded temporary file. Delegates to file archive processing when uploadType is "fileArchive".
      Parameters:
      fileKey - - unique key of the temporary uploaded file
      destinationFolder - - target folder path
      fileName - - name of the file to overwrite
      uploadType - - type of upload (e.g. "fileArchive" for archive files)
      request - - HTTP request
      Returns:
      JSON with operation result
    • keepboth

      @PostMapping(path="/keepboth", produces="application/json") public String keepboth(@RequestParam String fileKey, @RequestParam String destinationFolder, @RequestParam String fileName, @RequestParam String uploadType, jakarta.servlet.http.HttpServletRequest request)
      Keeps both the existing and uploaded file (creates a new version for archive, or renames for standard upload). Delegates to file archive processing when uploadType is "fileArchive".
      Parameters:
      fileKey - - unique key of the temporary uploaded file
      destinationFolder - - target folder path
      fileName - - original file name
      uploadType - - type of upload (e.g. "fileArchive" for archive files)
      request - - HTTP request
      Returns:
      JSON with operation result