Commit 4a45e630 authored by narinder Rana's avatar narinder Rana
Browse files

manage file event type CLOSE_WRITE

parent 5046ab5f
Pipeline #148353 passed with stage
in 3 minutes and 18 seconds
......@@ -61,19 +61,22 @@ public class FileObserverService extends Service {
@Override
public void onEvent(int event, File file) {
//Modify =2, create =256, delete =512, movedTo =128
if(event== FileObserver.CREATE ||
event==FileObserver.MODIFY ||
event== FileObserver.DELETE ||
event ==FileObserver.MOVED_TO){
if(event==FileObserver.CLOSE_WRITE){
// Log.e(TAG, "...CLOSE_WRITE ..." + event+"...file ..." + file);
// }
//
//
// //Modify =2, create =256, delete =512, movedTo =128
// if(event== FileObserver.CREATE ||
// event==FileObserver.MODIFY ||
// event== FileObserver.DELETE ||
// event ==FileObserver.MOVED_TO){
Log.i(TAG, "...Event ..." + event+"...file ..." + file);
String extension= file.getName().substring(
(file.getName().lastIndexOf('.')+1));
remoteFileFlag=false;
if(!file.isDirectory() & !extension.equals("mp4")){
if(!file.isDirectory() ){
for(File remoteFile:InitializerService.remoteDownloadFile){
if(remoteFile.getName().equals(file.getName())){
......@@ -82,7 +85,7 @@ public class FileObserverService extends Service {
}
}
Log.e(TAG, "....... extension..."+extension);
if(!files.contains(file) && !remoteFileFlag){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment