@InterfaceAudience.Public @InterfaceStability.Stable public class Trash extends Configured
| Constructor and Description |
|---|
Trash(Configuration conf)
Construct a trash can accessor.
|
Trash(FileSystem fs,
Configuration conf)
Construct a trash can accessor for the FileSystem provided.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkpoint()
Create a trash checkpoint.
|
void |
expunge()
Delete old checkpoint(s).
|
void |
expungeImmediately()
Delete all trash immediately.
|
Path |
getCurrentTrashDir(Path path) |
Runnable |
getEmptier()
Return a
Runnable that periodically empties the trash of all
users, intended to be run by the superuser. |
boolean |
isEnabled()
Returns whether the trash is enabled for this filesystem
|
static boolean |
moveToAppropriateTrash(FileSystem fs,
Path p,
Configuration conf)
In case of the symlinks or mount points, one has to move the appropriate
trashbin in the actual volume of the path p being deleted.
|
boolean |
moveToTrash(Path path)
Move a file or directory to the current trash directory.
|
getConf, setConfpublic Trash(Configuration conf) throws IOException
conf - a ConfigurationIOExceptionpublic Trash(FileSystem fs, Configuration conf) throws IOException
fs - the FileSystemconf - a ConfigurationIOExceptionpublic static boolean moveToAppropriateTrash(FileSystem fs, Path p, Configuration conf) throws IOException
fs - - the filesystem of path pp - - the path being deleted - to be moved to trasgconf - - configurationIOException - on errorpublic boolean isEnabled()
public boolean moveToTrash(Path path) throws IOException
IOExceptionpublic void checkpoint()
throws IOException
IOExceptionpublic void expunge()
throws IOException
IOExceptionpublic void expungeImmediately()
throws IOException
IOExceptionpublic Runnable getEmptier() throws IOException
Runnable that periodically empties the trash of all
users, intended to be run by the superuser.IOExceptionpublic Path getCurrentTrashDir(Path path) throws IOException
IOExceptionCopyright © 2022 Apache Software Foundation. All rights reserved.