@Service public class DefaultFileSystemService extends Object implements FileSystemService
| Modifier and Type | Field and Description |
|---|---|
static double |
REQUIRED_DISK_SPACE_SLACK_MULTIPLIER |
| Constructor and Description |
|---|
DefaultFileSystemService() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkEnoughUsableSpace(Path oldMule,
Path newMule,
List<Path> paths)
Validates whether there is potentially enough writable space on the file system for the upgrade.
|
void |
checkIsADirectory(Path path)
Checks whether a given path corresponds to a directory.
|
void |
checkReadingAccess(Path parentPath,
List<Path> relativePaths)
Checks whether the JVM has reading access to all file trees determined by the given relative paths when resolved against the
given parent path.
|
void |
checkWritingAccess(Path parentPath,
List<Path> relativePaths)
Checks whether the JVM has writing access to all file trees determined by the given relative paths when resolved against the
given parent path.
|
void |
copyFiles(Path srcDir,
Path destDir,
List<Path> paths)
Recursively copy all the files and directories determined by the given relative paths from the given source directory to the
given destination directory.
|
boolean |
isWindowsOs()
Checks whether the underlying OS is Windows.
|
public static final double REQUIRED_DISK_SPACE_SLACK_MULTIPLIER
public void checkIsADirectory(Path path) throws NotDirectoryException
checkIsADirectory in interface FileSystemServicepath - the path to an expected directory.NotDirectoryException - if given path is not a directory.public void checkWritingAccess(Path parentPath, List<Path> relativePaths) throws IOException
checkWritingAccess in interface FileSystemServiceparentPath - the parent path which is used for resolving the relative paths.relativePaths - list of all paths whose underlying tree will be validated for writing access.AccessDeniedException - if any path does not have writing accessibility.IOException - if any I/O error occurs.public void checkReadingAccess(Path parentPath, List<Path> relativePaths) throws IOException
checkReadingAccess in interface FileSystemServiceparentPath - the parent path which is used for resolving the relative paths.relativePaths - list of all paths whose underlying tree will be validated for reading access.AccessDeniedException - if any path does not have reading accessibility.IOException - if any I/O error occurs.public void checkEnoughUsableSpace(Path oldMule, Path newMule, List<Path> paths) throws IOException
checkEnoughUsableSpace in interface FileSystemServiceoldMule - the directory where the old Mule distro is located.newMule - the directory where the new Mule distro is located.paths - the relative paths of files involved in the upgrade process.{@link - IOException} In case of not finding enough usable space.IOExceptionpublic boolean isWindowsOs()
isWindowsOs in interface FileSystemServicepublic void copyFiles(Path srcDir, Path destDir, List<Path> paths) throws IOException
copyFiles in interface FileSystemServicesrcDir - the directory where the files will be copied from.destDir - the directory where the files will be copied to.paths - the relative paths that will be resolved against the source dir for copying them to the destination directory.IOException - if any I/O error occurs.Copyright © 2021 MuleSoft, Inc.. All rights reserved.