@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, setConf
public Trash(Configuration conf) throws IOException
conf
- a ConfigurationIOException
public Trash(FileSystem fs, Configuration conf) throws IOException
fs
- the FileSystemconf
- a ConfigurationIOException
public 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
IOException
public void checkpoint() throws IOException
IOException
public void expunge() throws IOException
IOException
public void expungeImmediately() throws IOException
IOException
public Runnable getEmptier() throws IOException
Runnable
that periodically empties the trash of all
users, intended to be run by the superuser.IOException
public Path getCurrentTrashDir(Path path) throws IOException
IOException
Copyright © 2021 Apache Software Foundation. All rights reserved.