<commit_before>package org.octoprint.api;

import org.json.simple.JSONAware;

import org.json.simple.JSONObject;
import org.octoprint.api.util.JSONLoader;

/**
 * A representation of a File on the OctoPrint server http://docs.octoprint.org/en/master/api/datamodel.html#sec-api-datamodel-files-file 
 * 
 * @author rweber
 * 
 */
public class OctoPrintFile implements JSONAware, JSONLoader {
	private JSONObject m_data = null;
	
	public OctoPrintFile() {
		
	}

	public String getName(){
		return m_data.get("name").toString();
	}
	
	/**
	 * @return the print time (in seconds) based on gcode analysis
	 */
	public double getPrintTime(){
		double result = 0;
		
		JSONObject gcode = (JSONObject)m_data.get("gcodeAnalysis");
		
		if(gcode != null)
		{
			result = (Double)gcode.get("estimatedPrintTime");
		}<commit_msg>this should b e Long<commit_after>package org.octoprint.api;

import org.json.simple.JSONAware;

import org.json.simple.JSONObject;
import org.octoprint.api.util.JSONLoader;

/**
 * A representation of a File on the OctoPrint server http://docs.octoprint.org/en/master/api/datamodel.html#sec-api-datamodel-files-file 
 * 
 * @author rweber
 * 
 */
public class OctoPrintFile implements JSONAware, JSONLoader {
	private JSONObject m_data = null;
	
	public OctoPrintFile() {
		
	}

	public String getName(){
		return m_data.get("name").toString();
	}
	
	/**
	 * @return the print time (in seconds) based on gcode analysis
	 */
	public Long getPrintTime(){
		Long result = new Long(0);
		
		JSONObject gcode = (JSONObject)m_data.get("gcodeAnalysis");
		
		if(gcode != null)
		{
			result = (Long)gcode.get("estimatedPrintTime");
		}
{'fraction_non_alphanumeric': 0.12629022465088038, 'fraction_numerical': 0.0012143290831815423, 'mean_word_length': 3.963855421686747, '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': '2396900', 'n_tokens_mistral': 611, 'n_tokens_neox': 552, 'n_words': 125}