|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.desktop.AbstractTrash
public abstract class AbstractTrash
AbstractTrash is an abstract representation of a file trash, i.e. a temporary place where deleted files are stored before the trash is emptied. A trash implementation provides methods to access basic trash operations: move files to the trash, empty the trash, ...
Since AbstractTrash implementations are system-dependent, they should not be instanciated directly.
Use DesktopManager.getTrash() to retrieve an instance of a trash implementation that can
be used on the current platform.
Also, some AbstractTrash subclasses may not be able to provide working implementations for all trash operations;
probe methods are provided to find out if a particular operation is available.
TrashProvider,
DesktopManager.getTrash()| Constructor Summary | |
|---|---|
AbstractTrash()
|
|
| Method Summary | |
|---|---|
abstract boolean |
canEmpty()
Returns true if this trash can be emptied. |
abstract boolean |
canMoveToTrash(AbstractFile file)
Returns true if the specified file is eligible for being moved to the trash. |
abstract boolean |
canOpen()
Returns true if this trash can be opened in the default file manager of the current OS/Desktop manager
by calling open(). |
abstract boolean |
empty()
Attempts to empty this trash and returns true if it was successfully emptied. |
abstract int |
getItemCount()
Returns the number of items that currently are in this trash, -1 if this information is not available. |
abstract boolean |
isTrashFile(AbstractFile file)
Returns true if the given file is a trash folder, or one of its children. |
abstract boolean |
moveToTrash(AbstractFile file)
Attempts to move the given file to the trash and returns true if the file could be moved successfully. |
abstract void |
open()
Opens the trash in the default file manager of the current OS/Desktop manager. |
abstract void |
waitForPendingOperations()
Waits (locks the caller thread) until all pending trash operations are completed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTrash()
| Method Detail |
|---|
public abstract boolean canMoveToTrash(AbstractFile file)
true if the specified file is eligible for being moved to the trash. This doesn't mean that
a call to moveToTrash(com.mucommander.file.AbstractFile) will necessarily succeed, but it should at least ensure that basic
prerequisites are met.
file - the file to test
public abstract boolean moveToTrash(AbstractFile file)
true if the file could be moved successfully.
file - the file to move to the trash
public abstract boolean canEmpty()
true if this trash can be emptied.
public abstract boolean empty()
true if it was successfully emptied.
public abstract boolean isTrashFile(AbstractFile file)
true if the given file is a trash folder, or one of its children.
For example, if /home/someuser/.Trash is a trash folder, calling this method with:
/home/someuser/.Trash will return true
/home/someuser/.Trash/somefolder/somefile will return true
/home/someuser/Desktop will return false
Note that this method does not check the existence of the given file, the test is solely based on the file's path.
file - the file to test
public abstract int getItemCount()
-1 if this information is not available.
-1 if this information is not availablepublic abstract void open()
public abstract boolean canOpen()
true if this trash can be opened in the default file manager of the current OS/Desktop manager
by calling open().
public abstract void waitForPendingOperations()
AbstractTrash implementations are asynchroneous, i.e. perform
operations in separate threads.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard