www.dextsolution.com
DEXTUPLOAD
JK
menu toggleReference > dextuploadjk > engine > BulkSaveOption

dextuploadjk.engine
Class BulkSaveOption

Minimum version
1.0.0
Minimum environment
Java 17, Jakarta EE 9+
Description

This is a class that sets the options needed when saving a large number of temporary files. Used in the saveAll method of the FileUpload class.

BulkSaveOption option = new BulkSaveOption();
option.setTargetDirectoryPath("/home/user/others/");
option.setOverwrite(true);
option.setCopy(true);
fileUpload.saveAll(option);
Constructor

BulkSaveOption

  • Creates an object of the BulkSaveOption class.
  • Signatures

    public BulkSaveOption()
    public BulkSaveOption(String targetDirectoryPath, boolean overwrite, boolean copy, boolean nfc)
  • Parameters

    Name Type Description
    targetDirectoryPath java.lang.String Directory path to save the file
    overwrite boolean Whether to overwrite duplicate files
    copy boolean Whether to remove temporary files
    nfc boolean Whether to change to Unicode normalization form
Methods

getTargetDirectoryPath

  • Returns the directory path where the file will be saved.
  • Signatures

    public String getTargetDirectoryPath()
  • Return

    Directory path

setTargetDirectoryPath

  • Set the directory path to save the file.

  • Signatures

    public void setTargetDirectoryPath(String targetDirectoryPath)
  • Parameters

    Name Type Description
    targetDirectoryPath java.lang.String Directory path
  • Uses

    BulkSaveOption option = new BulkSaveOption();
    option.setTargetDirectoryPath("/home/user/others/");

isOverwrite

  • Returns whether to overwrite duplicate files.

  • Signatures

    public boolean isOverwrite()
  • Return

    true or false (default)

setOverwrite

  • Set whether to overwrite duplicate files.

    When DEXTUploadJK saves a file, if there is a duplicate file with the same file name, a suffix value is automatically added to the file name. However, in systems that process many requests simultaneously, such as the web, there is a possibility that even the suffix value may be duplicated for a very short period of time. Therefore, even if the overwrite argument value is false, file writing may sometimes fail. To avoid this situation as much as possible, when saving a file, do not save the original file name, but change the file name to prevent duplicate names as much as possible.

  • Signatures

    public void setOverwrite(boolean overwrite)
  • Parameters

    Name Type Description
    overwrite boolean true or false
  • Uses

    BulkSaveOption option = new BulkSaveOption();
    option.setOverwrite(true);

isCopy

  • Returns whether to remove temporary files.

  • Signatures

    public boolean isCopy()
  • Return

    true or false (default)

setCopy

  • Set whether to remove temporary files.

    DEXTUploadJK removes temporary files immediately after saving the file. Therefore, you cannot use the FileItem.save method by calling it multiple times. If you want to keep the temporary file without deleting it, set the copy property to true.

  • Signatures

    public void setCopy(boolean copy)
  • Parameters

    Name Type Description
    copy boolean true or false
  • Uses

    BulkSaveOption option = new BulkSaveOption();
    option.setCopy(true);

isNfc

  • Returns whether the file name is changed to NFC Unicode normalization form.

  • Signatures

    public boolean isNfc()
  • Return

    true or false (default)

setNfc

  • Set whether to change the file name to NFC Unicode normalization form.

    Unlike Windows/Linux, macOS manages file or directory names using the nfd normalization form. For name compatibility between macOS and Windows/Linux, when changing NFC is necessary, set the nfc property to true.

  • Signatures

    public void setNfc(boolean nfc)
  • Parameters

    Name Type Description
    nfc boolean true or false
  • Uses

    BulkSaveOption option = new BulkSaveOption();
    option.setNfc(true);