FileObserverpublic abstract class FileObserver extends Object
Fields Summary |
---|
public static final int | ACCESS | public static final int | MODIFY | public static final int | ATTRIB | public static final int | CLOSE_WRITE | public static final int | CLOSE_NOWRITE | public static final int | OPEN | public static final int | MOVED_FROM | public static final int | MOVED_TO | public static final int | CREATE | public static final int | DELETE | public static final int | DELETE_SELF | public static final int | MOVE_SELF | public static final int | ALL_EVENTS | private static final String | LOG_TAG | private static ObserverThread | s_observerThread | private String | m_path | private Integer | m_descriptor | private int | m_mask |
Constructors Summary |
---|
public FileObserver(String path)
this(path, ALL_EVENTS);
| public FileObserver(String path, int mask)
m_path = path;
m_mask = mask;
m_descriptor = -1;
|
Methods Summary |
---|
protected void | finalize()
stopWatching();
| public abstract void | onEvent(int event, java.lang.String path)
| public void | startWatching()
if (m_descriptor < 0) {
m_descriptor = s_observerThread.startWatching(m_path, m_mask, this);
}
| public void | stopWatching()
if (m_descriptor >= 0) {
s_observerThread.stopWatching(m_descriptor);
m_descriptor = -1;
}
|
|