Add support for .woomy files

This commit is contained in:
Maschell 2019-05-04 12:08:15 +02:00
parent bcf60a889f
commit 5e05c65efd
3 changed files with 38 additions and 1 deletions

View File

@ -92,7 +92,7 @@
<dependency>
<groupId>com.github.Maschell</groupId>
<artifactId>JNUSLib</artifactId>
<version>3eb299d</version>
<version>95802c7</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>

View File

@ -0,0 +1,31 @@
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
import java.io.File;
import java.util.Optional;
import de.mas.wiiu.jnus.NUSTitleLoaderWoomy;
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle;
public class WoomyNUSTitleContainer extends GroupFuseContainer {
private final File file;
public WoomyNUSTitleContainer(Optional<FuseDirectory> parent, File file) {
super(parent);
this.file = file;
}
@Override
protected void doInit() {
this.addFuseContainer(file.getName(), new FSTDataProviderContainer(Optional.of(this), () -> {
try {
return new FSTDataProviderNUSTitle(NUSTitleLoaderWoomy.loadNUSTitle(file.getAbsolutePath()));
} catch (Exception e1) {
e1.printStackTrace();
return null;
}
}));
}
}

View File

@ -11,6 +11,7 @@ import de.mas.wiiu.jnus.fuse_wiiu.implementation.LocalNUSTitleContainer;
import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDFuseContainer;
import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDMountedFuseContainer;
import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDToWUDContainer;
import de.mas.wiiu.jnus.fuse_wiiu.implementation.WoomyNUSTitleContainer;
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer;
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
import de.mas.wiiu.jnus.implementations.wud.reader.WUDDiscReaderSplitted;
@ -41,6 +42,11 @@ public class FuseContainerWrapper {
}
}
if (c.exists() && c.getName().endsWith(".woomy")) {
result.put(prefix + c.getName(), new WoomyNUSTitleContainer(parent, c));
return result;
}
if (checkWUD(result, parent, c)) {
return result;
}