Package sk.iway.iwcm.admin.upload
Class AdminUploadController
java.lang.Object
sk.iway.iwcm.admin.upload.AdminUploadController
REST controller handling file upload conflict resolution (skip, overwrite, keep-both).
Supports both standard file uploads and file archive uploads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionkeepboth(String fileKey, String destinationFolder, String fileName, 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).overwrite(String fileKey, String destinationFolder, String fileName, String uploadType, jakarta.servlet.http.HttpServletRequest request) Overwrites an existing file with the uploaded temporary file.Skips (deletes) a temporarily uploaded file identified by its key.
-
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 filerequest- - 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 filedestinationFolder- - target folder pathfileName- - name of the file to overwriteuploadType- - 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 filedestinationFolder- - target folder pathfileName- - original file nameuploadType- - type of upload (e.g. "fileArchive" for archive files)request- - HTTP request- Returns:
- JSON with operation result
-