F - the generic type of the ExternalFileSystem on which the operation is performedpublic abstract class ExternalFileCommand<F extends ExternalFileSystem> extends AbstractFileCommand<F,URI>
AbstractFileCommand for local file systems which use URI to identify and manage
files and directories.fileSystem| Modifier | Constructor and Description |
|---|---|
protected |
ExternalFileCommand(F externalFileSystem)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected URI |
getAbsolutePath(URI uri)
Returns an object representing the absolute path for the given path.
|
protected URI |
getParent(URI uri)
Returns the parent path, or
null if this path does not
have a parent. |
protected String |
pathToString(URI uri) |
protected URI |
resolvePath(URI baseUri,
String filePath)
Resolve the given basePath against the filePath.
|
alreadyExistsException, assureParentFolderExists, cannotListFileException, cannotReadDirectoryException, doMkDirs, exception, exception, exists, getBasePath, isVirtualDirectory, mkdirs, pathNotFoundException, resolveExistingPath, resolvePathprotected ExternalFileCommand(F externalFileSystem)
externalFileSystem - the ExternalFileSystem on which the operation is performedprotected String pathToString(URI uri)
pathToString in class AbstractFileCommand<F extends ExternalFileSystem,URI><I> as a String.protected URI getAbsolutePath(URI uri)
If the given path is already absolute then this method simply returns it. Otherwise, this method resolves the path in an implementation dependent manner, typically by resolving the path against a file system default directory. Depending on the implementation, this method may throw an I/O error if the file system is not accessible.
getAbsolutePath in class AbstractFileCommand<F extends ExternalFileSystem,URI>uri - the given pathURIprotected URI getParent(URI uri)
null if this path does not
have a parent.
The parent of this path object consists of this path's root
component, if any, and each element in the path except for the
farthest from the root in the directory hierarchy. This method
does not access the file system; the path or its parent may not exist.
Furthermore, this method does not eliminate special names such as "."
and ".." that may be used in some implementations. On UNIX for example,
the parent of "/a/b/c" is "/a/b", and the parent of
"x/y/." is "x/y".
getParent in class AbstractFileCommand<F extends ExternalFileSystem,URI>URIprotected URI resolvePath(URI baseUri, String filePath)
If the filePath parameter is an absolute
path then this method trivially returns filePath. If filePath
is an empty path then this method trivially returns basePath.
Otherwise this method considers the basePath to be a directory and resolves
the given filePath against the basePath. In the simplest case, the given filePath
does not have a root component, in which case this method
joins both paths and returns a resulting path
that ends with the given filePath. Where the given filePath has
a root component then resolution is highly implementation dependent and
therefore unspecified.
resolvePath in class AbstractFileCommand<F extends ExternalFileSystem,URI>baseUri - the base path considered as a directoryfilePath - the path to resolve against the basePathURICopyright © 2003–2019 MuleSoft, Inc.. All rights reserved.