mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Possibly fix Apache VFS / junrar memory leak
-> https://www.filebot.net/forums/viewtopic.php?f=6&t=6061
This commit is contained in:
parent
7d313e8f23
commit
c3199e85be
@ -9,12 +9,13 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.vfs2.AllFileSelector;
|
import org.apache.commons.vfs2.AllFileSelector;
|
||||||
|
import org.apache.commons.vfs2.CacheStrategy;
|
||||||
import org.apache.commons.vfs2.FileObject;
|
import org.apache.commons.vfs2.FileObject;
|
||||||
import org.apache.commons.vfs2.FileSelectInfo;
|
import org.apache.commons.vfs2.FileSelectInfo;
|
||||||
import org.apache.commons.vfs2.FileSelector;
|
import org.apache.commons.vfs2.FileSelector;
|
||||||
import org.apache.commons.vfs2.FileSystemManager;
|
|
||||||
import org.apache.commons.vfs2.FileType;
|
import org.apache.commons.vfs2.FileType;
|
||||||
import org.apache.commons.vfs2.VFS;
|
import org.apache.commons.vfs2.cache.NullFilesCache;
|
||||||
|
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
|
||||||
|
|
||||||
import net.filebot.vfs.FileInfo;
|
import net.filebot.vfs.FileInfo;
|
||||||
import net.filebot.vfs.SimpleFileInfo;
|
import net.filebot.vfs.SimpleFileInfo;
|
||||||
@ -23,7 +24,7 @@ public class ApacheVFS implements ArchiveExtractor, Closeable {
|
|||||||
|
|
||||||
private static final FileSelector ALL_FILES = new AllFileSelector();
|
private static final FileSelector ALL_FILES = new AllFileSelector();
|
||||||
|
|
||||||
private final FileSystemManager fsm;
|
private final DefaultFileSystemManager fsm;
|
||||||
private final FileObject archive;
|
private final FileObject archive;
|
||||||
|
|
||||||
public ApacheVFS(File file) throws Exception {
|
public ApacheVFS(File file) throws Exception {
|
||||||
@ -31,7 +32,9 @@ public class ApacheVFS implements ArchiveExtractor, Closeable {
|
|||||||
throw new FileNotFoundException(file.getAbsolutePath());
|
throw new FileNotFoundException(file.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fsm = VFS.getManager();
|
this.fsm = new DefaultFileSystemManager();
|
||||||
|
this.fsm.setCacheStrategy(CacheStrategy.MANUAL);
|
||||||
|
this.fsm.setFilesCache(new NullFilesCache());
|
||||||
this.archive = fsm.createFileSystem(fsm.toFileObject(file));
|
this.archive = fsm.createFileSystem(fsm.toFileObject(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user