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);
NUSDataProvider dataProvider = getDataProvider();
for(Content c : list){
System.out.println("Saving " + c.getFilename());
if(withHashes){
dataProvider.saveEncryptedContentWithH3Hash(c, outputFolder);
}else{

View File

@ -29,7 +29,7 @@ public class NUSTitleLoaderWUD extends NUSTitleLoader {
WUDImage image = new WUDImage(wudFile);
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()){
System.out.println(keyFile.getAbsolutePath() + " does not exist and no title key was provided.");
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");
}
}
System.out.println("Saving " + content.getFilename());
FileUtils.saveInputStreamToFile(output,inputStream,content.getEncryptedFileSize());
}

View File

@ -94,7 +94,7 @@ public class WUDImage {
private long calculateSplittedFileSize() {
long result = 0;
File filehandlePart1 = getFileHandle();
File filehandlePart1 = new File(getFileHandle().getAbsolutePath());
String pathToFiles = filehandlePart1.getParentFile().getAbsolutePath();
for(int i = 1; i<=WUDDiscReaderSplitted.NUMBER_OF_FILES;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{
File filehandlePart1 = getImage().getFileHandle();
File filehandlePart1 = new File(getImage().getFileHandle().getAbsolutePath()); //Create copy
String pathToFiles = filehandlePart1.getParentFile().getAbsolutePath();
int filePart = getFilePartByOffset(offset);

View File

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