Commit 6de07962 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

Disable synchronisation of new locale hidden files & folders

parent 95579189
Pipeline #20766 passed with stage
in 2 minutes and 35 seconds
...@@ -23,8 +23,8 @@ public class FileFilterFactory { ...@@ -23,8 +23,8 @@ public class FileFilterFactory {
case "Applications": case "Applications":
filter = new AppSettingsFileFilter(); filter = new AppSettingsFileFilter();
break; break;
case "Images": case "media":
filter = new ImagesFileFilter(); filter = new MediaFileFilter();
break; break;
default: default:
filter = new NoCacheFileFilter(); filter = new NoCacheFileFilter();
......
...@@ -10,12 +10,17 @@ package foundation.e.drive.fileFilters; ...@@ -10,12 +10,17 @@ package foundation.e.drive.fileFilters;
import java.io.File; import java.io.File;
import java.io.FileFilter; import java.io.FileFilter;
import foundation.e.drive.utils.CommonUtils;
/** /**
* @author Vincent Bourgmayer * @author Vincent Bourgmayer
*/ */
class ImagesFileFilter implements FileFilter { class MediaFileFilter implements FileFilter {
@Override @Override
public boolean accept(File file) { public boolean accept(File file) {
return !file.isDirectory() || !file.getName().equals( ".thumbnails" ); //Return true if it's not a hidden file
return !file.isHidden();
} }
} }
...@@ -551,7 +551,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene ...@@ -551,7 +551,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
folderIdList.add( (long) syncedFolder.getId() ); folderIdList.add( (long) syncedFolder.getId() );
} }
final FileFilter filter = FileFilterFactory.getFileFilter( syncedFolder.getLibelle() ); final FileFilter filter = FileFilterFactory.getFileFilter( (syncedFolder.isMediaType()) ? "media" : syncedFolder.getLibelle() );
File[] subElements = folder.listFiles(filter); File[] subElements = folder.listFiles(filter);
Log.v(TAG, "loop through subfiles"); Log.v(TAG, "loop through subfiles");
for (int i = -1, subEltSize = (subElements != null)? subElements.length: 0; ++i < subEltSize; ) { for (int i = -1, subEltSize = (subElements != null)? subElements.length: 0; ++i < subEltSize; ) {
......
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