ContentFilterable
, Describable
, FileTreeElement
@NonExtensible public interface FileCopyDetails extends FileTreeElement, ContentFilterable, Describable
Provides details about a file or directory about to be copied, and allows some aspects of the destination file to be modified.
Using this interface, you can change the destination path of the file, filter the content of the file, or exclude the file from the result entirely.
Access to the source file itself after any filters have been added is not a supported operation.
Modifier and Type | Method | Description |
---|---|---|
void |
exclude() |
Excludes this file from the copy.
|
DuplicatesStrategy |
getDuplicatesStrategy() |
The strategy to use if there is already a file at this file's destination.
|
java.lang.String |
getName() |
Returns the base name of this file at the copy destination.
|
java.lang.String |
getPath() |
Returns the path of this file, relative to the root of the copy destination.
|
RelativePath |
getRelativePath() |
Returns the path of this file, relative to the root of the copy destination.
|
RelativePath |
getRelativeSourcePath() |
Returns the path of this file, relative to the root of the containing file tree.
|
java.lang.String |
getSourceName() |
Returns the base name of this file at the copy source.
|
java.lang.String |
getSourcePath() |
Returns the path of this file, relative to the root of the containing file tree.
|
void |
permissions(Action<? super ConfigurableFilePermissions> configureAction) |
Configuration action for specifying file and directory access permissions.
|
void |
setDuplicatesStrategy(DuplicatesStrategy strategy) |
The strategy to use if there is already a file at this file's destination.
|
void |
setMode(int mode) |
Sets the Unix permissions of this file.
|
void |
setName(java.lang.String name) |
Sets the destination name of this file.
|
void |
setPath(java.lang.String path) |
Sets the destination path of this file.
|
void |
setPermissions(FilePermissions permissions) |
Set file and directory access permissions based on an externally
provided permission instance.
|
void |
setRelativePath(RelativePath path) |
Sets the destination path of this file.
|
expand, expand, filter, filter, filter, filter
getDisplayName
copyTo, copyTo, getFile, getLastModified, getMode, getPermissions, getSize, isDirectory, open
void exclude()
void setName(java.lang.String name)
name
- The destination name of this file.void setPath(java.lang.String path)
path
- The path of this file.void setRelativePath(RelativePath path)
path
- the new path for this file.void setMode(int mode)
mode
- the Unix permissions, e.g. 0644
.permissions(Action)
instead.@Incubating void permissions(Action<? super ConfigurableFilePermissions> configureAction)
ConfigurableFilePermissions
.@Incubating void setPermissions(FilePermissions permissions)
ConfigurableFilePermissions
.void setDuplicatesStrategy(DuplicatesStrategy strategy)
DuplicatesStrategy getDuplicatesStrategy()
The value can be set with a case-insensitive string of the enum value (e.g. 'exclude'
for DuplicatesStrategy.EXCLUDE
).
DuplicatesStrategy
java.lang.String getName()
getName
in interface FileTreeElement
java.lang.String getPath()
Always uses '/' as the hierarchy separator, regardless of platform file separator.
Same as calling getRelativePath().getPathString()
.
getPath
in interface FileTreeElement
RelativePath getRelativePath()
getRelativePath
in interface FileTreeElement
java.lang.String getSourceName()
java.lang.String getSourcePath()
Always uses '/' as the hierarchy separator, regardless of platform file separator.
Same as calling getRelativeSourcePath().getPathString()
.
RelativePath getRelativeSourcePath()