<commit_before>package com.conveyal.analyst.server.jobs;

import com.conveyal.analyst.server.AnalystMain;
import models.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Run geom2gtfs with the given shapefile and config file for the given scenario.
 * @author mattwigway
 *
 */
public class Geom2GtfsJob implements Runnable {
	private static final Logger LOG = LoggerFactory.getLogger(Geom2GtfsJob.class);

	private File configFile;
	private File shapeFile;
	private File newFile;
	private Bundle bundle;
	
	public Geom2GtfsJob(Bundle bundle, File configFile, File shapeFile, File newFile) {
		this.bundle = bundle;
		this.configFile = configFile;
		this.shapeFile = shapeFile;
		this.newFile = newFile;
	}
	
	@Override
	public void run() {
		try {			
			// overwrite
			if (newFile.exists())
				newFile.delete();
	
			ProcessBuilder pb = new ProcessBuilder("java"
					,"-jar",new File(AnalystMain.config.getProperty("application.bin"), "geom2gtfs.jar").getAbsolutePath(),  shapeFile.getAbsolutePath(), configFile.getAbsolutePath(), newFile.getAbsolutePath());
			// show messages from stderr as well
			pb.redirectErrorStream(true);
			Process p;
			p = pb.start();
	
			BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(p.getInputStream()));
			String line;
	
			while((line = bufferedReader.readLine()) != null){
				LOG.info("geom2gtfs: " + line);
			}
	
			LOG.info("shapefile " + shapeFile.getName() + " processed.");
		} catch (IOException e) {
			// rethrow as unchecked
			throw new RuntimeException(e);
		}
	}

}
<commit_msg>get geom2gtfs working again.<commit_after>package com.conveyal.analyst.server.jobs;

import com.conveyal.geom2gtfs.Main;
import models.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

/**
 * Run geom2gtfs with the given shapefile and config file for the given scenario.
 * @author mattwigway
 *
 */
public class Geom2GtfsJob implements Runnable {
	private static final Logger LOG = LoggerFactory.getLogger(Geom2GtfsJob.class);

	private File configFile;
	private File shapeFile;
	private File newFile;
	private Bundle bundle;
	
	public Geom2GtfsJob(Bundle bundle, File configFile, File shapeFile, File newFile) {
		this.bundle = bundle;
		this.configFile = configFile;
		this.shapeFile = shapeFile;
		this.newFile = newFile;
	}
	
	@Override
	public void run() {
		// overwrite
		if (newFile.exists())
			newFile.delete();

		// this is cloogy - we're calling a Java main function from inside a Java program
		try {
			Main.main(new String[] { shapeFile.getAbsolutePath(), configFile.getAbsolutePath(),
					newFile.getAbsolutePath() });
		} catch (Exception e) {
			LOG.error("geom2gtfs error", e);
			return;
		}

		LOG.info("shapefile " + shapeFile.getName() + " processed.");
	}
}

{'fraction_non_alphanumeric': 0.11229031153714482, 'fraction_numerical': 0.005819924683327628, 'mean_word_length': 4.208556149732621, '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': '828324', 'n_tokens_mistral': 1034, 'n_tokens_neox': 930, 'n_words': 235}