FileSystem
File system utilities.
Initializers
import com.aliyun.ros.cdk.core.FileSystem;
new FileSystem();
Name | Type | Description |
---|---|---|
Static Functions
Name | Description |
---|---|
copyDirectory |
Copies an entire directory structure. |
fingerprint |
Produces fingerprint based on the contents of a single file or an entire directory tree. |
isEmpty |
Checks whether a directory is empty. |
mkdtemp |
Creates a unique temporary directory in the system temp directory. |
copyDirectory
import com.aliyun.ros.cdk.core.FileSystem;
FileSystem.copyDirectory(java.lang.String srcDir, java.lang.String destDir),FileSystem.copyDirectory(java.lang.String srcDir, java.lang.String destDir, CopyOptions options),FileSystem.copyDirectory(java.lang.String srcDir, java.lang.String destDir, CopyOptions options, java.lang.String rootDir)
Copies an entire directory structure.
- Type: java.lang.String
Source directory.
- Type: java.lang.String
Destination directory.
- Type: CopyOptions
options.
- Type: java.lang.String
Root directory to calculate exclusions from.
fingerprint
import com.aliyun.ros.cdk.core.FileSystem;
FileSystem.fingerprint(java.lang.String fileOrDirectory),FileSystem.fingerprint(java.lang.String fileOrDirectory, FingerprintOptions options)
Produces fingerprint based on the contents of a single file or an entire directory tree.
Line endings are converted from CRLF to LF.
The fingerprint will also include:
- An extra string if defined in
options.extra
. - The symlink follow mode value.
- Type: java.lang.String
The directory or file to fingerprint.
- Type: FingerprintOptions
Fingerprinting options.
isEmpty
import com.aliyun.ros.cdk.core.FileSystem;
FileSystem.isEmpty(java.lang.String dir)
Checks whether a directory is empty.
- Type: java.lang.String
The directory to check.
mkdtemp
import com.aliyun.ros.cdk.core.FileSystem;
FileSystem.mkdtemp(java.lang.String prefix)
Creates a unique temporary directory in the system temp directory.
- Type: java.lang.String
A prefix for the directory name.
Six random characters will be generated and appended behind this prefix.
Properties
Name | Type | Description |
---|---|---|
tmpdir |
java.lang.String |
The real path of the system temp directory. |
tmpdir
Required
public java.lang.String getTmpdir();
- Type: java.lang.String
The real path of the system temp directory.