// Path: realm-browser/src/main/java/de/jonasrottmann/realmbrowser/basemvp/BaseInteractorImpl.java
// @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
// public abstract class BaseInteractorImpl<P extends BasePresenter> implements BaseInteractor {
//     private final P presenter;
// 
//     protected P getPresenter() {
//         return presenter;
//     }
// 
//     protected BaseInteractorImpl(P presenter) {
//         this.presenter = presenter;
//     }
// }
// 
// Path: realm-browser/src/main/java/de/jonasrottmann/realmbrowser/files/model/FilesPojo.java
// @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
// public class FilesPojo {
//     private final String name;
//     private final String size;
//     private final long sizeInByte;
// 
//     public FilesPojo(String name, String size, long sizeInByte) {
//         this.name = name;
//         this.size = size;
//         this.sizeInByte = sizeInByte;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getSize() {
//         return size;
//     }
// 
//     public long getSizeInByte() {
//         return sizeInByte;
//     }
// }


import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.RestrictTo;
import android.text.format.Formatter;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import de.jonasrottmann.realmbrowser.basemvp.BaseInteractorImpl;
import de.jonasrottmann.realmbrowser.files.model.FilesPojo;
package de.jonasrottmann.realmbrowser.files;




@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
class FilesInteractor extends BaseInteractorImpl<FilesContract.Presenter> implements FilesContract.Interactor {
    private static List<String> ignoreExtensionList = new ArrayList<>();

    static {
        ignoreExtensionList.add(".log");
        ignoreExtensionList.add(".log_a");
        ignoreExtensionList.add(".log_b");
        ignoreExtensionList.add(".lock");
        ignoreExtensionList.add(".management");
        ignoreExtensionList.add(".temp");
    }


    FilesInteractor(FilesContract.Presenter presenter) {
        super(presenter);
    }

    private boolean isValidFileName(String fileName) {
        return fileName.lastIndexOf(".") > 0 && !ignoreExtensionList.contains(fileName.substring(fileName.lastIndexOf(".")));
    }

    @Override
    public void requestForContentUpdate(@NonNull Context context) {
        File dataDir = new File(context.getApplicationInfo().dataDir, "files");
        File[] files = dataDir.listFiles();
        ArrayList<FilesPojo> fileList = new ArrayList<>();
        if (files != null) {
            for (File file : files) {
// Path: realm-browser/src/main/java/de/jonasrottmann/realmbrowser/basemvp/BaseInteractorImpl.java
// @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
// public abstract class BaseInteractorImpl<P extends BasePresenter> implements BaseInteractor {
//     private final P presenter;
// 
//     protected P getPresenter() {
//         return presenter;
//     }
// 
//     protected BaseInteractorImpl(P presenter) {
//         this.presenter = presenter;
//     }
// }
// 
// Path: realm-browser/src/main/java/de/jonasrottmann/realmbrowser/files/model/FilesPojo.java
// @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
// public class FilesPojo {
//     private final String name;
//     private final String size;
//     private final long sizeInByte;
// 
//     public FilesPojo(String name, String size, long sizeInByte) {
//         this.name = name;
//         this.size = size;
//         this.sizeInByte = sizeInByte;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getSize() {
//         return size;
//     }
// 
//     public long getSizeInByte() {
//         return sizeInByte;
//     }
// }


// Path: realm-browser/src/main/java/de/jonasrottmann/realmbrowser/files/FilesInteractor.java
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.RestrictTo;
import android.text.format.Formatter;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import de.jonasrottmann.realmbrowser.basemvp.BaseInteractorImpl;
import de.jonasrottmann.realmbrowser.files.model.FilesPojo;

package de.jonasrottmann.realmbrowser.files;




@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
class FilesInteractor extends BaseInteractorImpl<FilesContract.Presenter> implements FilesContract.Interactor {
    private static List<String> ignoreExtensionList = new ArrayList<>();

    static {
        ignoreExtensionList.add(".log");
        ignoreExtensionList.add(".log_a");
        ignoreExtensionList.add(".log_b");
        ignoreExtensionList.add(".lock");
        ignoreExtensionList.add(".management");
        ignoreExtensionList.add(".temp");
    }


    FilesInteractor(FilesContract.Presenter presenter) {
        super(presenter);
    }

    private boolean isValidFileName(String fileName) {
        return fileName.lastIndexOf(".") > 0 && !ignoreExtensionList.contains(fileName.substring(fileName.lastIndexOf(".")));
    }

    @Override
    public void requestForContentUpdate(@NonNull Context context) {
        File dataDir = new File(context.getApplicationInfo().dataDir, "files");
        File[] files = dataDir.listFiles();
        ArrayList<FilesPojo> fileList = new ArrayList<>();
        if (files != null) {
            for (File file : files) {
                String fileName = file.getName();