mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-02 08:25:02 -04:00
* simplify common usage
This commit is contained in:
parent
28260e51d7
commit
aefa0f064a
@ -10,6 +10,10 @@ public class FileMapper implements ExtractOutProvider {
|
||||
private File outputDir;
|
||||
private boolean flatten;
|
||||
|
||||
public FileMapper(File outputDir) {
|
||||
this(outputDir, false);
|
||||
};
|
||||
|
||||
public FileMapper(File outputDir, boolean flatten) {
|
||||
this.outputDir = outputDir;
|
||||
this.flatten = flatten;
|
||||
|
@ -79,12 +79,12 @@ public class SevenZipNativeBindings implements ArchiveExtractor, Closeable {
|
||||
|
||||
@Override
|
||||
public void extract(File outputDir) throws Exception {
|
||||
extract(new FileMapper(outputDir, false));
|
||||
extract(new FileMapper(outputDir));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extract(File outputDir, FileFilter filter) throws Exception {
|
||||
extract(new FileMapper(outputDir, false), filter);
|
||||
extract(new FileMapper(outputDir), filter);
|
||||
}
|
||||
|
||||
public void extract(ExtractOutProvider outputMapper) throws SevenZipException {
|
||||
|
@ -1135,7 +1135,7 @@ public class CmdlineOperations implements CmdlineInterface {
|
||||
}
|
||||
|
||||
CLILogger.info(String.format("Read archive [%s] and extract to [%s]", file.getName(), outputFolder));
|
||||
final FileMapper outputMapper = new FileMapper(outputFolder, false);
|
||||
final FileMapper outputMapper = new FileMapper(outputFolder);
|
||||
|
||||
final List<FileInfo> outputMapping = new ArrayList<FileInfo>();
|
||||
for (FileInfo it : archive.listFiles()) {
|
||||
|
@ -249,7 +249,7 @@ class ExtractTool extends Tool<TableModel> {
|
||||
|
||||
Archive archive = Archive.open(file);
|
||||
try {
|
||||
final FileMapper outputMapper = new FileMapper(outputFolder, false);
|
||||
final FileMapper outputMapper = new FileMapper(outputFolder);
|
||||
|
||||
final List<FileInfo> outputMapping = new ArrayList<FileInfo>();
|
||||
for (FileInfo it : archive.listFiles()) {
|
||||
|
Loading…
Reference in New Issue
Block a user