/**
 * @author <a href="mailto:goran_schwarz@hotmail.com">Goran Schwarz</a>
 */
package com.sap.dbmtk.demo;

import java.io.File;

public class Version
{
	public static       String PRODUCT_STRING     = System.getProperty("APPL_NAME", "DemoClient"); // Do not have spaces etc in this one
	public static final String VERSION_STRING     = "1.0.1";
//	public static final String VERSION_STRING     = "1.0.0.0.dev"; 
	public static final String BUILD_STRING       = "2015-12-01/build 16"; 

//	public static final boolean IS_DEVELOPMENT_VERSION  = true; // if true: date expiration will be checked on startup
//	public static final String  DEV_VERSION_EXPIRE_STR  = "2015-10-30";  // "YYYY-MM-DD" 
//	public static       Date    DEV_VERSION_EXPIRE_DATE = null;

	public static final String SOURCE_DATE_STRING = "$Date: 2014-10-03 13:51:41 +0200 (fr, 03 okt 2014) $";
	public static final String SOURCE_REV_STRING  = "$Revision: 425 $";

	public static final String APP_STORE_DIR = System.getProperty("user.home") + File.separator + ".dbmtk";

//	static
//	{
//		try
//		{
//			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//			DEV_VERSION_EXPIRE_DATE = sdf.parse(DEV_VERSION_EXPIRE_STR);
//		}
//		catch(ParseException e)
//		{
//			System.out.println(e.getMessage());
//		}
//	}

	/** This normally NOT used */
	public static void setAppName(String appname)
	{
		PRODUCT_STRING = appname;
	}

	public static String getAppName()
	{
		return PRODUCT_STRING;
	}

	public static String getVersionStr()
	{
		return VERSION_STRING;
	}

	public static String getBuildStr()
	{
		return BUILD_STRING;
	}

	public static String getSourceDate()
	{
		return SOURCE_DATE_STRING.replaceFirst("\\$Date: ", "").replaceFirst(" \\$", "").substring(0, "yyyy-mm-dd HH:MM:SS".length());
	}
	public static String getSourceRev()
	{
		return SOURCE_REV_STRING.replaceFirst("\\$Revision: ", "").replaceFirst(" \\$", "");
	}
}

