Configurable@Public @Stable public class Trash extends Configured
| Constructor | 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 | Description |
|---|---|---|
void |
checkpoint() |
Create a trash checkpoint.
|
void |
expunge() |
Delete old checkpoint(s).
|
void |
expungeImmediately() |
Delete all trash immediately.
|
Path |
getCurrentTrashDir(Path path) |
|
java.lang.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 java.io.IOException
conf - a Configurationjava.io.IOException - raised on errors performing I/O.public Trash(FileSystem fs, Configuration conf) throws java.io.IOException
fs - the FileSystemconf - a Configurationjava.io.IOException - raised on errors performing I/O.public static boolean moveToAppropriateTrash(FileSystem fs, Path p, Configuration conf) throws java.io.IOException
fs - - the filesystem of path pp - - the path being deleted - to be moved to trashconf - - configurationjava.io.IOException - on errorpublic boolean isEnabled()
public boolean moveToTrash(Path path) throws java.io.IOException
path - the path.java.io.IOException - raised on errors performing I/O.public void checkpoint()
throws java.io.IOException
java.io.IOException - raised on errors performing I/O.public void expunge()
throws java.io.IOException
java.io.IOException - raised on errors performing I/O.public void expungeImmediately()
throws java.io.IOException
java.io.IOException - raised on errors performing I/O.public java.lang.Runnable getEmptier()
throws java.io.IOException
Runnable that periodically empties the trash of all
users, intended to be run by the superuser.java.io.IOException - on raised on errors performing I/O.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.