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

dextuploadjk.engine
Enum FileCopyOption

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

Indicates how to copy a file.

ConstantDescription
Stream Copy files using a buffer stream. It is affected by methods of the Environment object.
Channel Channel NIO (Non-blocking I/O) Copies files using the transferTo method of the Channel class. It has higher performance benefits compared to the Stream method. (Default value)
ScatterGather Copy files using the Scatter/Gather method with the NIO Channel class. It is affected by methods of the Environment object.
MemoryMapping Copy files using the memory mapping method with the NIO Channel class.

How to set FileCopyOption is as follows.

# When setting directly to the Environment object
Environment env = new Environment();
env.setFileCopyOption(FileCopyOption.Stream);

# When setting in Spring's DispatcherServlet context XML
<property name="fileCopyOption" value="Stream"/>

# When set with the JKExtensionUploadFilter or JKSpringExtensionUploadFilter parameter
<init-param>
  <param-name>fileCopyOption</param-name>
  <param-value>Stream</param-value>
</init-param>