<commit_before>package de.peeeq.wurstscript.mpq;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

import de.peeeq.wurstscript.WLogger;
import de.peeeq.wurstscript.utils.Debug;

public class LadikMpq implements MpqEditor {

	LadikMpq() {
	}
	
	@Override
	public File extractFile(File mpqArchive, String fileToExtract)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File tempFile1 = new File("./temp/" + fileToExtract);
		File script = MoPaqScriptfiles.extractFile(mpqArchive, "war3map.j");
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};
		Debug.println(Arrays.toString(commands));
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			Debug.println(line);
			WLogger.info(line);
		}
		tempFile1 = new File("./temp/" + fileToExtract); 
		if (!tempFile1.exists()) {
			throw new Error("could not extract file");
		}
		return tempFile1;
		
	}

	@Override
	public void insertFile(File mpqArchive, String filenameInMpq, File tempFile)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File script = MoPaqScriptfiles.insertFile(mpqArchive, tempFile, filenameInMpq);
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}

	@Override
	public void deleteFile(File mpqArchive, String filenameInMpq)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File script = MoPaqScriptfiles.deleteMapfile(mpqArchive, filenameInMpq);
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};		
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}
	
	public void compact(File mpqArchive)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		String[] commands = {MpqEditorFactory.getFilepath(),"/console", "compact", mpqArchive.getAbsolutePath()};
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}

	@Override
	public void compactArchive(File mpqArchive) throws IOException,
			InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File script = MoPaqScriptfiles.compactMapfile(mpqArchive);
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};		
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}

}
<commit_msg>mopaq scriptfiles now get removed<commit_after>package de.peeeq.wurstscript.mpq;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

import de.peeeq.wurstscript.WLogger;
import de.peeeq.wurstscript.utils.Debug;

public class LadikMpq implements MpqEditor {

	LadikMpq() {
	}
	
	@Override
	public File extractFile(File mpqArchive, String fileToExtract)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File tempFile1 = new File("./temp/" + fileToExtract);
		File script = MoPaqScriptfiles.extractFile(mpqArchive, "war3map.j");
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};
		Debug.println(Arrays.toString(commands));
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			Debug.println(line);
			WLogger.info(line);
		}
		tempFile1 = new File("./temp/" + fileToExtract); 
		if (!tempFile1.exists()) {
			throw new Error("could not extract file");
		}
		script.delete();
		return tempFile1;
		
	}

	@Override
	public void insertFile(File mpqArchive, String filenameInMpq, File tempFile)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File script = MoPaqScriptfiles.insertFile(mpqArchive, tempFile, filenameInMpq);
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		script.delete();
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}

	@Override
	public void deleteFile(File mpqArchive, String filenameInMpq)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File script = MoPaqScriptfiles.deleteMapfile(mpqArchive, filenameInMpq);
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};		
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		script.delete();
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}
	
	public void compact(File mpqArchive)
			throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
		String[] commands = {MpqEditorFactory.getFilepath(),"/console", "compact", mpqArchive.getAbsolutePath()};
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}

	@Override
	public void compactArchive(File mpqArchive) throws IOException,
			InterruptedException {
		Runtime rt = Runtime.getRuntime();
		File script = MoPaqScriptfiles.compactMapfile(mpqArchive);
		
		String[] commands = {MpqEditorFactory.getFilepath(), "/console", script.getAbsolutePath()};		
		
		Process proc = rt.exec(commands);
		InputStream procOut = proc.getInputStream();
		BufferedReader procOutReader = new BufferedReader(new InputStreamReader(procOut));
		proc.waitFor();
		String line;
		script.delete();
		while ((line = procOutReader.readLine()) != null) {
			WLogger.info(line);
		}
		
	}

}

{'fraction_non_alphanumeric': 0.12213740458015267, 'fraction_numerical': 0.0013161358252171624, 'mean_word_length': 4.913618677042802, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2768226', 'n_tokens_mistral': 2599, 'n_tokens_neox': 2297, 'n_words': 506}