mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-22 16:09:18 +01:00
Fixed splitted files from a relativ path. Fixed output of current extraction
This commit is contained in:
parent
6b8efcaf53
commit
b332dc1bcd
@ -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{
|
||||||
|
@ -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;
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user