<commit_before>package com.specialneedsmutual.badgemaker.helpers;

import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;

import com.specialneedsmutual.badgemaker.utilities.PropertyFileReader;

/**
 * Convenience class which holds information about the selected source directory:<br>
 * -Number of JPG images in the directory<br>
 * -The number of pages it will take to show all the images<br>
 * -The file separator character<br>
 * -The child files in the directory
 * 
 * @author jacob.carter
 * 
 */
public class SourceDirectoryInfo {

	public final String		sourceDir;
	public final String[]	childFiles;
	public final String		fileSeparator;
	public final int		numberOfImages;
	public final int		numberOfPages;

	/**
	 * Creates a new instance and populates the data fields
	 * 
	 * @param sourceDir The source, like "c:\program files\someApplication"
	 * @throws IOException If something goes wrong
	 */
	public SourceDirectoryInfo(File sourceFile) throws IOException {
		File parentDirFile;
		int badgesPerPage;

		this.sourceDir = sourceFile.getCanonicalPath();
		parentDirFile = new File(this.sourceDir);

		childFiles = parentDirFile.list(new FilenameFilter() {

			@Override
			public boolean accept(File dir, String filename) {
				if (filename.endsWith(".jpg")) {
					return true;
				} else if (filename.endsWith(".JPG")) {
					return true;
				}
				return false;
			}
		});
		numberOfImages = childFiles.length;
		badgesPerPage = Integer.parseInt(PropertyFileReader.getProperty("badgesPerPage", "3"));
		numberOfPages = (int) Math.ceil((float) numberOfImages / (float) badgesPerPage);
		fileSeparator = System.getProperty("file.separator", "/");
	}

}<commit_msg>Ignore Mac garbage invisible files<commit_after>package com.specialneedsmutual.badgemaker.helpers;

import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;

import com.specialneedsmutual.badgemaker.utilities.PropertyFileReader;

/**
 * Convenience class which holds information about the selected source directory:<br>
 * -Number of JPG images in the directory<br>
 * -The number of pages it will take to show all the images<br>
 * -The file separator character<br>
 * -The child files in the directory
 * 
 * @author jacob.carter
 * 
 */
public class SourceDirectoryInfo {

	public final String		sourceDir;
	public final String[]	childFiles;
	public final String		fileSeparator;
	public final int		numberOfImages;
	public final int		numberOfPages;

	/**
	 * Creates a new instance and populates the data fields
	 * 
	 * @param sourceDir The source, like "c:\program files\someApplication"
	 * @throws IOException If something goes wrong
	 */
	public SourceDirectoryInfo(File sourceFile) throws IOException {
		File parentDirFile;
		int badgesPerPage;

		this.sourceDir = sourceFile.getCanonicalPath();
		parentDirFile = new File(this.sourceDir);

		childFiles = parentDirFile.list(new FilenameFilter() {

			@Override
			public boolean accept(File dir, String filename) {
				if(filename.startsWith("._")){
					return false;
				} else if (filename.endsWith(".jpg")) {
					return true;
				} else if (filename.endsWith(".JPG")) {
					return true;
				}
				return false;
			}
		});
		numberOfImages = childFiles.length;
		badgesPerPage = Integer.parseInt(PropertyFileReader.getProperty("badgesPerPage", "3"));
		numberOfPages = (int) Math.ceil((float) numberOfImages / (float) badgesPerPage);
		fileSeparator = System.getProperty("file.separator", "/");
	}

}
{'fraction_non_alphanumeric': 0.10051546391752578, 'fraction_numerical': 0.000572737686139748, 'mean_word_length': 4.316590563165906, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6988729', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1019, 'n_words': 296}