Search in sources :

Example 1 with DefaultFileSystem

use of com.frostwire.platform.DefaultFileSystem in project frostwire by frostwire.

the class AndroidPlatform method buildFileSystem.

private static FileSystem buildFileSystem(Application app) {
    FileSystem fs;
    if (Build.VERSION.SDK_INT >= VERSION_CODE_LOLLIPOP) {
        LollipopFileSystem lfs = new LollipopFileSystem(app);
        PosixCalls w = new PosixCalls(lfs);
        w.swigReleaseOwnership();
        libtorrent.set_posix_wrapper(w);
        // LibTorrent.setPosixWrapper(new PosixCalls(lfs));
        fs = lfs;
    } else {
        fs = new DefaultFileSystem() {

            @Override
            public void scan(File file) {
                Librarian.instance().scan(app, file);
            }
        };
    }
    return fs;
}
Also used : DefaultFileSystem(com.frostwire.platform.DefaultFileSystem) FileSystem(com.frostwire.platform.FileSystem) File(java.io.File) DocumentFile(android.support.v4.provider.DocumentFile) DefaultFileSystem(com.frostwire.platform.DefaultFileSystem)

Aggregations

DocumentFile (android.support.v4.provider.DocumentFile)1 DefaultFileSystem (com.frostwire.platform.DefaultFileSystem)1 FileSystem (com.frostwire.platform.FileSystem)1 File (java.io.File)1