Skip to content

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.

srcDirRequired

  • Type: java.lang.String

Source directory.


destDirRequired

  • Type: java.lang.String

Destination directory.


optionsOptional

options.


rootDirOptional

  • 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:

  1. An extra string if defined in options.extra.
  2. The symlink follow mode value.

fileOrDirectoryRequired

  • Type: java.lang.String

The directory or file to fingerprint.


optionsOptional

Fingerprinting options.


isEmpty

import com.aliyun.ros.cdk.core.FileSystem;
FileSystem.isEmpty(java.lang.String dir)

Checks whether a directory is empty.

dirRequired

  • 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.

prefixRequired

  • 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.

tmpdirRequired

public java.lang.String getTmpdir();
  • Type: java.lang.String

The real path of the system temp directory.