@@ -22,8 +22,20 @@ public class MainApp extends JFrame {
setLocationRelativeTo(null);
setLayout(newBorderLayout());
// Check if metadata file exists
if(!Files.exists(Paths.get("metadata.ser"))){
String[]languages={"en","es","pt","it"};
StringselectedLanguage=(String)JOptionPane.showInputDialog(this,"Metadata file not found. Please choose a language to build off of.","Language Selection",JOptionPane.PLAIN_MESSAGE,null,languages,languages[0]);
System.out.println("Previous compressed data size: "+compression_size+" bytes. Current compressed data size: "+compressedData.length+" bytes. Delta: "+(compressedData.length-compression_size)+" bytes.");
outputCallback.accept("\nPrevious compressed data size: "+compression_size+" bytes. Current compressed data size: "+compressedData.length+" bytes. Delta: "+(compressedData.length-compression_size)+" bytes.");
System.out.println("Size limit exceeded. Reverting to previous chunk.");
outputCallback.accept("\nSize limit exceeded. Reverting to previous chunk.");
sizeLimitExceeded=true;
uncompressedData=previousUncompressedData;// Revert to the previous uncompressed data
compressedData=compress(uncompressedData);// Recompress the reverted state
@@ -205,6 +238,7 @@ public class crawler {
writeToFile(compressedData,filePath);
if(!sizeLimitExceeded){
System.out.println("Compressed tree exported successfully to: "+filePath);
outputCallback.accept("\nCompressed tree exported successfully to: "+filePath);
}else{
System.out.println("Compressed data truncated due to size limit.");
}
@@ -214,12 +248,16 @@ public class crawler {
// Output sizes of both compressed and uncompressed data for reference