@Override public void onEvent(int event,String path){
  Log_OC.d(TAG,"Got event " + event + " on FOLDER "+ mPath+ " about "+ ((path != null) ? path : ""));
  boolean shouldSynchronize=false;
synchronized (mObservedChildren) {
    if (path != null && path.length() > 0 && mObservedChildren.containsKey(path)) {
      if (((event & FileObserver.MODIFY) != 0) || ((event & FileObserver.ATTRIB) != 0) || ((event & FileObserver.MOVED_TO) != 0)) {
        if (!mObservedChildren.get(path)) {
          mObservedChildren.put(path,Boolean.valueOf(true));
        }
      }
      if ((event & FileObserver.CLOSE_WRITE) != 0 && mObservedChildren.get(path)) {
        mObservedChildren.put(path,Boolean.valueOf(false));
        shouldSynchronize=true;
      }
    }
  }
  if (shouldSynchronize) {
    startSyncOperation(path);
  }
  if ((event & IN_IGNORE) != 0 && (path == null || path.length() == 0)) {
    Log_OC.d(TAG,"Stopping the observance on " + mPath);
  }
}

@ Override public void onEvent ( int event , String path ) { Log_OC . d ( TAG , "Got event " + event + " on FOLDER " + mPath + " about " + ( ( path != null ) ? path : "" ) ) ; boolean shouldSynchronize = false ; synchronized ( mObservedChildren ) { if ( path != null && path . length ( ) > 0 && mObservedChildren . containsKey ( path ) ) { if ( ( ( event & FileObserver . MODIFY ) != 0 ) || ( ( event & FileObserver . ATTRIB ) != 0 ) || ( ( event & FileObserver . MOVED_TO ) != 0 ) ) { if ( ! mObservedChildren . get ( path ) ) { mObservedChildren . put ( path , Boolean . valueOf ( true ) ) ; } } if ( ( event & FileObserver . CLOSE_WRITE ) != 0 && mObservedChildren . get ( path ) ) { mObservedChildren . put ( path , Boolean . valueOf ( false ) ) ; shouldSynchronize = true ; } } } if ( shouldSynchronize ) { startSyncOperation ( path ) ; } if ( ( event & IN_IGNORE ) != 0 && ( path == null || path . length ( ) == 0 ) ) { Log_OC . d ( TAG , "Stopping the observance on " + mPath ) ; } }
receives and processes events about updates of the monitor folder and its children files .
