Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1292ab62 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Transform FileEventListener interface into class

- Get FileEventListener implementation from Narinder's work branch and merge it
merge it with FileEventListener interface.
parent 277bb13c
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -8,11 +8,23 @@

package foundation.e.drive.FileObservers;

import android.os.FileObserver;
import android.util.Log;

import java.io.File;

/**
 * @author Narinder Rana
 */
public interface FileEventListener  {
    void onEvent(int event, File file);
public class FileEventListener  {
    private final static String TAG = FileEventListener.class.getSimpleName();

    public void onEvent(int event, File file){
        if (event== FileObserver.CLOSE_WRITE){ //Event triggered after modification/creation
            Log.d(TAG, "CLOSE_WRITE event for :"+file.getName());
        }
        if (event== FileObserver.DELETE_SELF ){
            Log.d(TAG, "DELETE_SELF event for :"+file.getName());
        }
    }
}