Fixed splitted files from a relativ path. Fixed output of current extraction

This commit is contained in:
Maschell 2016-12-22 21:32:14 +01:00
parent 6b8efcaf53
commit b332dc1bcd
6 changed files with 5 additions and 5 deletions

View File

@ -62,7 +62,6 @@ public class ExtractionService {
Utils.createDir(outputFolder); Utils.createDir(outputFolder);
NUSDataProvider dataProvider = getDataProvider(); NUSDataProvider dataProvider = getDataProvider();
for(Content c : list){ for(Content c : list){
System.out.println("Saving " + c.getFilename());
if(withHashes){ if(withHashes){
dataProvider.saveEncryptedContentWithH3Hash(c, outputFolder); dataProvider.saveEncryptedContentWithH3Hash(c, outputFolder);
}else{ }else{

View File

@ -29,7 +29,7 @@ public class NUSTitleLoaderWUD extends NUSTitleLoader {
WUDImage image = new WUDImage(wudFile); WUDImage image = new WUDImage(wudFile);
if(titleKey == null){ if(titleKey == null){
File keyFile = new File(wudFile.getParentFile().getPath() + File.separator + Settings.WUD_KEY_FILENAME); File keyFile = new File(new File(wudFile.getAbsolutePath()).getParentFile().getPath() + File.separator + Settings.WUD_KEY_FILENAME);
if(!keyFile.exists()){ if(!keyFile.exists()){
System.out.println(keyFile.getAbsolutePath() + " does not exist and no title key was provided."); System.out.println(keyFile.getAbsolutePath() + " does not exist and no title key was provided.");
return null; return null;

View File

@ -96,6 +96,7 @@ public abstract class NUSDataProvider {
log.info("Encrypted content alreadys exists, but the length is not as expected. Saving it again"); log.info("Encrypted content alreadys exists, but the length is not as expected. Saving it again");
} }
} }
System.out.println("Saving " + content.getFilename());
FileUtils.saveInputStreamToFile(output,inputStream,content.getEncryptedFileSize()); FileUtils.saveInputStreamToFile(output,inputStream,content.getEncryptedFileSize());
} }

View File

@ -94,7 +94,7 @@ public class WUDImage {
private long calculateSplittedFileSize() { private long calculateSplittedFileSize() {
long result = 0; long result = 0;
File filehandlePart1 = getFileHandle(); File filehandlePart1 = new File(getFileHandle().getAbsolutePath());
String pathToFiles = filehandlePart1.getParentFile().getAbsolutePath(); String pathToFiles = filehandlePart1.getParentFile().getAbsolutePath();
for(int i = 1; i<=WUDDiscReaderSplitted.NUMBER_OF_FILES;i++){ for(int i = 1; i<=WUDDiscReaderSplitted.NUMBER_OF_FILES;i++){
String filePartPath = pathToFiles + File.separator + String.format(WUDDiscReaderSplitted.WUD_SPLITTED_DEFAULT_FILEPATTERN, i); String filePartPath = pathToFiles + File.separator + String.format(WUDDiscReaderSplitted.WUD_SPLITTED_DEFAULT_FILEPATTERN, i);

View File

@ -76,7 +76,7 @@ public class WUDDiscReaderSplitted extends WUDDiscReader{
} }
private RandomAccessFile getFileByOffset(long offset) throws IOException{ private RandomAccessFile getFileByOffset(long offset) throws IOException{
File filehandlePart1 = getImage().getFileHandle(); File filehandlePart1 = new File(getImage().getFileHandle().getAbsolutePath()); //Create copy
String pathToFiles = filehandlePart1.getParentFile().getAbsolutePath(); String pathToFiles = filehandlePart1.getParentFile().getAbsolutePath();
int filePart = getFilePartByOffset(offset); int filePart = getFilePartByOffset(offset);

View File

@ -14,7 +14,7 @@ public class FileUtils {
if(target.isDirectory()){ if(target.isDirectory()){
return false; return false;
} }
File parent = target.getParentFile(); File parent = new File(target.getAbsolutePath()).getParentFile();
if(parent != null){ if(parent != null){
Utils.createDir(parent.getAbsolutePath()); Utils.createDir(parent.getAbsolutePath());
} }