<commit_before>/**
 * 
 */
package gov.nih.nci.calab.dto.workflow;

import gov.nih.nci.calab.service.util.CalabConstants;
import gov.nih.nci.calab.service.util.PropertyReader;

import java.io.File;
import java.util.Date;

/**
 * @author zengje
 * 
 */
public class FileBean {

	private String id = "";

	private String path = "";

	private String filename = "";

	private String createDateStr = "";

	private String fileSubmitter = "";

	private String fileMaskStatus = "";

	private Date createdDate;

	/**
	 * 
	 */
	public FileBean() {
		super();
		// TODO Auto-generated constructor stub
	}

	// used in WorkflowResultBean
	public FileBean(String path, String fileSubmissionDate,
			String fileSubmitter, String fileMaskStatus) {
		this.path = path;
		this.createDateStr = fileSubmissionDate;
		this.fileSubmitter = fileSubmitter;
		this.fileMaskStatus = fileMaskStatus;
	}

	public FileBean(String id, String path) {
		super();
		// TODO Auto-generated constructor stub
		this.id = id;
		this.path = path;
		this.filename = parsePath(path);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
		this.filename = parsePath(path);
	}

	public String getFilename() {
		return filename;
	}

	// public void setFilename(String filename) {
	// this.filename = filename;
	// }
	//	

	private String parsePath(String path) {
		String rootpath = PropertyReader.getProperty(
				CalabConstants.FILEUPLOAD_PROPERTY, "fileRepositoryDir");
		File file = new File(rootpath + path);
		return file.getName();
	}

	public String getFileMaskStatus() {
		return fileMaskStatus;
	}

	public void setFileMaskStatus(String fileMaskStatus) {
		this.fileMaskStatus = fileMaskStatus;
	}

	public String getCreateDateStr() {
		return createDateStr;
	}

	public void setCreateDateStr(String fileSubmissionDate) {
		this.createDateStr = fileSubmissionDate;
	}

	public String getFileSubmitter() {
		return fileSubmitter;
	}

	public void setFileSubmitter(String fileSubmitter) {
		this.fileSubmitter = fileSubmitter;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

}<commit_msg>added shortFilename for displaying on the tree<commit_after>/**
 * 
 */
package gov.nih.nci.calab.dto.workflow;

import gov.nih.nci.calab.service.util.CalabConstants;
import gov.nih.nci.calab.service.util.PropertyReader;

import java.io.File;
import java.util.Date;

/**
 * @author zengje
 * 
 */
public class FileBean {

	private String id = "";

	private String path = "";

	private String filename = "";

	private String createDateStr = "";

	private String fileSubmitter = "";

	private String fileMaskStatus = "";

	private Date createdDate;
	
	private String shortFilename="";

	/**
	 * 
	 */
	public FileBean() {
		super();
		// TODO Auto-generated constructor stub
	}

	// used in WorkflowResultBean
	public FileBean(String path, String fileSubmissionDate,
			String fileSubmitter, String fileMaskStatus) {
		this.path = path;
		this.createDateStr = fileSubmissionDate;
		this.fileSubmitter = fileSubmitter;
		this.fileMaskStatus = fileMaskStatus;
		this.filename = getFileName(path);
	}

	public FileBean(String id, String path) {
		super();
		// TODO Auto-generated constructor stub
		this.id = id;
		this.path = path;
		this.filename = getFileName(path);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
		this.filename = getFileName(path);
	}

	public String getFilename() {
		return filename;
	}

	// public void setFilename(String filename) {
	// this.filename = filename;
	// }
	//	

	private String getFileName(String path) {
		String[] tokens = path.split("/");
		return tokens[tokens.length-1];
	}
	

	public String getFileMaskStatus() {
		return fileMaskStatus;
	}

	public void setFileMaskStatus(String fileMaskStatus) {
		this.fileMaskStatus = fileMaskStatus;
	}

	public String getCreateDateStr() {
		return createDateStr;
	}

	public void setCreateDateStr(String fileSubmissionDate) {
		this.createDateStr = fileSubmissionDate;
	}

	public String getFileSubmitter() {
		return fileSubmitter;
	}

	public void setFileSubmitter(String fileSubmitter) {
		this.fileSubmitter = fileSubmitter;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getShortFilename() {
		return shortFilename;
	}

	public void setShortFilename(String shortFileName) {
		this.shortFilename = shortFileName;
	}
}
{'fraction_non_alphanumeric': 0.1077116512992456, 'fraction_numerical': 0.00020955574182732607, 'mean_word_length': 3.8953846153846152, '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': '1209104', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1507, 'n_words': 365}