// Path: shim/src/main/java/info/vancauwenberge/filedriver/Build.java
// public class Build {
// 
// 	/** The build of your driver. */
// 	public static final String BUILD_NO;
// 
// 	/** The version of your driver. */
// 	static public final String PRODUCT_VERSION;
// 
// 	/** Your company name. */
// 	static public final String COMPANY_NAME;
// 
// 	/** The name of your driver. */
// 	static public final String PRODUCT_NAME;
// 
// 	static{
// 		final Class<Build> clazz = Build.class;
// 		final String className = clazz.getSimpleName() + ".class";
// 		Manifest manifest = null;
// 		try {
// 			final URLConnection connection = clazz.getResource(className).openConnection();
// 			if (connection instanceof JarURLConnection){
// 				manifest = ((JarURLConnection)connection).getManifest();
// 			}else{
// 				// Class not from JAR, but from the file system.
// 				final String classPath = clazz.getResource(className).toString();
// 				final String packageName = clazz.getPackage().getName();
// 				final String manifestPath = classPath.substring(0, classPath.length()-className.length()-packageName.length()-1) + "META-INF" + File.separatorChar + "MANIFEST.MF";
// 				manifest = new Manifest(new URL(manifestPath).openStream());
// 			}
// 		} catch (final Exception e1) {
// 			e1.printStackTrace();
// 		}
// 		final Attributes attr  = manifest==null?null:manifest.getMainAttributes();
// 		BUILD_NO = getAttribute("Built-Date",attr);
// 		PRODUCT_VERSION = getProductVersion(BUILD_NO,getAttribute("Implementation-Version",attr));
// 		COMPANY_NAME  = getAttribute("Implementation-Vendor",attr);
// 		PRODUCT_NAME = getAttribute("Implementation-Title",attr);
// 	}
// 	/*
// 	 * Get an attribute from the manifest, or unknown if no manifest is defined.
// 	 */
// 	private static String getAttribute(final String name, final Attributes attr ){
// 		if (attr!= null){
// 			final String value = attr.getValue(name);
// 			if (value != null) {
// 				return value;
// 			}
// 		}
// 		return "unknown";
// 	}
// 
// 	/**
// 	 * We reformat the date time in buildNo to YYYYMMDD-HHMMSS and append that to the productVersion
// 	 * @param buildNo
// 	 * @param productVesion
// 	 * @return
// 	 */
// 	private static String getProductVersion(final String buildNo, final String productVesion) {
// 		final SimpleDateFormat fromDf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 		fromDf.setTimeZone(TimeZone.getTimeZone("UTC"));
// 		final SimpleDateFormat toDf = new SimpleDateFormat("yyyyMMddHHmm");
// 		toDf.setTimeZone(TimeZone.getTimeZone("UTC"));
// 		try{
// 			return productVesion+"."+toDf.format(fromDf.parse(buildNo));
// 		}catch (final Exception e) {
// 			e.printStackTrace();
// 			return productVesion;
// 		}
// 	}
// }


import info.vancauwenberge.filedriver.Build;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
/*			XmlDocument initDoc = new XmlDocument(initDocStr);
			XDSInitDocument initDocument = new XDSInitDocument(initDoc);
			HashMap<String,Parameter> paramDefs = new HashMap<String,Parameter>(6);

	        //Add file namer as param
			Parameter param1 = new Parameter("newFile_MaxFileAge", //tag name
	                "0", //default value (optional)
	                DataType.INT); //data type
	        param1.add(RequiredConstraint.REQUIRED);
	        param1.add(RequiredConstraint.REQUIRED);
	        param1.add(rc);
	        paramDefs.put(param1.tagName(), param1);

	        Parameter param2 = new Parameter("newFile_MaxRecords", //tag name
	                "0", //default value (optional)
	                DataType.INT); //data type
	        param2.add(RequiredConstraint.REQUIRED);
	        param2.add(RequiredConstraint.REQUIRED);
	        param2.add(rc);
	        paramDefs.put(param2.tagName(), param2);
	        initDocument.parameters(paramDefs);
	        
	        System.out.println(rc);
	        System.out.println("Param:"+param1.toInteger());*/
// Path: shim/src/main/java/info/vancauwenberge/filedriver/Build.java
// public class Build {
// 
// 	/** The build of your driver. */
// 	public static final String BUILD_NO;
// 
// 	/** The version of your driver. */
// 	static public final String PRODUCT_VERSION;
// 
// 	/** Your company name. */
// 	static public final String COMPANY_NAME;
// 
// 	/** The name of your driver. */
// 	static public final String PRODUCT_NAME;
// 
// 	static{
// 		final Class<Build> clazz = Build.class;
// 		final String className = clazz.getSimpleName() + ".class";
// 		Manifest manifest = null;
// 		try {
// 			final URLConnection connection = clazz.getResource(className).openConnection();
// 			if (connection instanceof JarURLConnection){
// 				manifest = ((JarURLConnection)connection).getManifest();
// 			}else{
// 				// Class not from JAR, but from the file system.
// 				final String classPath = clazz.getResource(className).toString();
// 				final String packageName = clazz.getPackage().getName();
// 				final String manifestPath = classPath.substring(0, classPath.length()-className.length()-packageName.length()-1) + "META-INF" + File.separatorChar + "MANIFEST.MF";
// 				manifest = new Manifest(new URL(manifestPath).openStream());
// 			}
// 		} catch (final Exception e1) {
// 			e1.printStackTrace();
// 		}
// 		final Attributes attr  = manifest==null?null:manifest.getMainAttributes();
// 		BUILD_NO = getAttribute("Built-Date",attr);
// 		PRODUCT_VERSION = getProductVersion(BUILD_NO,getAttribute("Implementation-Version",attr));
// 		COMPANY_NAME  = getAttribute("Implementation-Vendor",attr);
// 		PRODUCT_NAME = getAttribute("Implementation-Title",attr);
// 	}
// 	/*
// 	 * Get an attribute from the manifest, or unknown if no manifest is defined.
// 	 */
// 	private static String getAttribute(final String name, final Attributes attr ){
// 		if (attr!= null){
// 			final String value = attr.getValue(name);
// 			if (value != null) {
// 				return value;
// 			}
// 		}
// 		return "unknown";
// 	}
// 
// 	/**
// 	 * We reformat the date time in buildNo to YYYYMMDD-HHMMSS and append that to the productVersion
// 	 * @param buildNo
// 	 * @param productVesion
// 	 * @return
// 	 */
// 	private static String getProductVersion(final String buildNo, final String productVesion) {
// 		final SimpleDateFormat fromDf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 		fromDf.setTimeZone(TimeZone.getTimeZone("UTC"));
// 		final SimpleDateFormat toDf = new SimpleDateFormat("yyyyMMddHHmm");
// 		toDf.setTimeZone(TimeZone.getTimeZone("UTC"));
// 		try{
// 			return productVesion+"."+toDf.format(fromDf.parse(buildNo));
// 		}catch (final Exception e) {
// 			e.printStackTrace();
// 			return productVesion;
// 		}
// 	}
// }


// Path: shim/src/main/java/info/vancauwenberge/filedriver/util/Test.java
import info.vancauwenberge.filedriver.Build;


	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
/*			XmlDocument initDoc = new XmlDocument(initDocStr);
			XDSInitDocument initDocument = new XDSInitDocument(initDoc);
			HashMap<String,Parameter> paramDefs = new HashMap<String,Parameter>(6);

	        //Add file namer as param
			Parameter param1 = new Parameter("newFile_MaxFileAge", //tag name
	                "0", //default value (optional)
	                DataType.INT); //data type
	        param1.add(RequiredConstraint.REQUIRED);
	        param1.add(RequiredConstraint.REQUIRED);
	        param1.add(rc);
	        paramDefs.put(param1.tagName(), param1);

	        Parameter param2 = new Parameter("newFile_MaxRecords", //tag name
	                "0", //default value (optional)
	                DataType.INT); //data type
	        param2.add(RequiredConstraint.REQUIRED);
	        param2.add(RequiredConstraint.REQUIRED);
	        param2.add(rc);
	        paramDefs.put(param2.tagName(), param2);
	        initDocument.parameters(paramDefs);
	        
	        System.out.println(rc);
	        System.out.println("Param:"+param1.toInteger());*/
	        System.out.println(Build.BUILD_NO);