// Path: src/main/java/org/ihtsdo/snomed/util/SnomedUtilException.java
// public class SnomedUtilException extends Exception {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public SnomedUtilException(String msg, Throwable t) {
// 		super(msg, t);
// 	}
// 
// 	public SnomedUtilException(String msg) {
// 		super(msg);
// 	}
// }


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.commons.io.FileUtils;
import org.ihtsdo.snomed.util.SnomedUtilException;
		File file = new File(fileName);
		if (!file.exists()) {
			if (file.getParentFile() != null) {
				file.getParentFile().mkdirs();
			} 
			file.createNewFile();
		}
		return file;
	}
	
	/**
	 * @return an array of 3 elements containing:  The path, the filename, the file extension (if it exists) or empty strings
	 */
	public static String[] deconstructFilename(File file) {
		String[] parts = new String[] {"","",""};
		
		if (file== null) {
			return parts;
		}
		parts[0] = file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator));
		if (file.getName().lastIndexOf(".") > 0) {
			parts[1] = file.getName().substring(0, file.getName().lastIndexOf("."));
			parts[2] = file.getName().substring(file.getName().lastIndexOf(".") + 1);
		} else {
			parts[1] = file.getName();
		}
		
		return parts;
	}
	
// Path: src/main/java/org/ihtsdo/snomed/util/SnomedUtilException.java
// public class SnomedUtilException extends Exception {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public SnomedUtilException(String msg, Throwable t) {
// 		super(msg, t);
// 	}
// 
// 	public SnomedUtilException(String msg) {
// 		super(msg);
// 	}
// }


// Path: src/main/java/org/ihtsdo/util/GlobalUtils.java
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.commons.io.FileUtils;
import org.ihtsdo.snomed.util.SnomedUtilException;

		File file = new File(fileName);
		if (!file.exists()) {
			if (file.getParentFile() != null) {
				file.getParentFile().mkdirs();
			} 
			file.createNewFile();
		}
		return file;
	}
	
	/**
	 * @return an array of 3 elements containing:  The path, the filename, the file extension (if it exists) or empty strings
	 */
	public static String[] deconstructFilename(File file) {
		String[] parts = new String[] {"","",""};
		
		if (file== null) {
			return parts;
		}
		parts[0] = file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator));
		if (file.getName().lastIndexOf(".") > 0) {
			parts[1] = file.getName().substring(0, file.getName().lastIndexOf("."));
			parts[2] = file.getName().substring(file.getName().lastIndexOf(".") + 1);
		} else {
			parts[1] = file.getName();
		}
		
		return parts;
	}
	
	public static void createArchive(File dirToZip, String zipFileOrigName) throws SnomedUtilException {