// Path: src/org/sleeksnap/Constants.java
// public class Constants {
// 	public static class Application {
// 		public static final String NAME = "Sleeksnap";
// 		public static final String URL = "http://sleeksnap.com";
// 		public static final String UPDATE_URL = "http://sleeksnap.com/build/";
// 	}
// 
// 	public static class Configuration {
// 		public static final String FILE_NAME = Application.NAME.toLowerCase()
// 				+ ".conf";
// 
// 		public static final int DEFAULT_MAX_RETRIES = 3;
// 		
// 		public static final String DEFAULT_LANGUAGE = "english";
// 	}
// 
// 	public static class Resources {
// 		public static final String LOGO_PATH = "/logo.png";
// 		public static final String ICON_PATH = "/icon.png";
// 		public static final String ICON_BUSY_PATH = "/icon-busy.png";
// 		
// 		public static final URL ICON = Util.getResourceByName(Resources.ICON_PATH);
// 		public static final URL ICON_BUSY = Util.getResourceByName(Resources.ICON_BUSY_PATH);
// 		
// 		public static final Image ICON_IMAGE = Toolkit.getDefaultToolkit().getImage(ICON);
// 		public static final Image ICON_BUSY_IMAGE = Toolkit.getDefaultToolkit().getImage(ICON_BUSY);
// 	}
// 	
// 	public static class Version {
// 		public static final int MAJOR = 1;
// 		public static final int MINOR = 4;
// 		public static final int PATCH = 9;
// 		
// 		private static String versionString = null;
// 		
// 		public static String getVersionString() {
// 			if(versionString == null) {
// 				// Construct string normally
// 				versionString = MAJOR + "." + MINOR + "." + PATCH;
// 			}
// 			return  versionString;
// 		}
// 	}
// }
// 
// Path: src/org/sleeksnap/Constants.java
// public static class Application {
// 	public static final String NAME = "Sleeksnap";
// 	public static final String URL = "http://sleeksnap.com";
// 	public static final String UPDATE_URL = "http://sleeksnap.com/build/";
// }
// 
// Path: src/org/sleeksnap/Constants.java
// public static class Version {
// 	public static final int MAJOR = 1;
// 	public static final int MINOR = 4;
// 	public static final int PATCH = 9;
// 		
// 	private static String versionString = null;
// 		
// 	public static String getVersionString() {
// 		if(versionString == null) {
// 			// Construct string normally
// 			versionString = MAJOR + "." + MINOR + "." + PATCH;
// 		}
// 		return  versionString;
// 	}
// }


import org.sleeksnap.Constants;
import org.sleeksnap.Constants.Application;
import org.sleeksnap.Constants.Version;
import java.awt.Desktop;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.swing.JFrame;
import javax.swing.UIManager;
/**
 * Sleeksnap, the open source cross-platform screenshot uploader
 * Copyright (C) 2012 Nikki <nikki@nikkii.us>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.sleeksnap.util;




/**
 * A basic utility class
 * 
 * @author Nikki
 * 
 */
public class Util {
	/**
	 * An enum containing operating system types
	 * 
	 * @author Nikki
	 * 
	 */
	public static enum OperatingSystem {
		LINUX, SOLARIS, WINDOWS, MAC, UNKNOWN
	}

	/**
	 * The cached operating system
	 */
	public static final OperatingSystem SYSTEM = getPlatform();

	/**
	 * The saved working directory
	 */
	private static File workDir;

	/**
	 * A method to get the unix time...
	 * @return
	 * 		The current time in seconds
	 */
	public static long currentTimeSeconds() {
		return (System.currentTimeMillis() / 1000);
	}

	/**
	 * Get the last part of a class name
	 * 
	 * @param key
	 *            The full name
	 * @return The class name formatted
	 */
	public static String formatClassName(Class<?> key) {
		return key.getName().substring(key.getName().lastIndexOf('.') + 1);
	}

	/**
	 * Get the computer's user agent
	 * 
	 */
	public static String getHttpUserAgent() {
// Path: src/org/sleeksnap/Constants.java
// public class Constants {
// 	public static class Application {
// 		public static final String NAME = "Sleeksnap";
// 		public static final String URL = "http://sleeksnap.com";
// 		public static final String UPDATE_URL = "http://sleeksnap.com/build/";
// 	}
// 
// 	public static class Configuration {
// 		public static final String FILE_NAME = Application.NAME.toLowerCase()
// 				+ ".conf";
// 
// 		public static final int DEFAULT_MAX_RETRIES = 3;
// 		
// 		public static final String DEFAULT_LANGUAGE = "english";
// 	}
// 
// 	public static class Resources {
// 		public static final String LOGO_PATH = "/logo.png";
// 		public static final String ICON_PATH = "/icon.png";
// 		public static final String ICON_BUSY_PATH = "/icon-busy.png";
// 		
// 		public static final URL ICON = Util.getResourceByName(Resources.ICON_PATH);
// 		public static final URL ICON_BUSY = Util.getResourceByName(Resources.ICON_BUSY_PATH);
// 		
// 		public static final Image ICON_IMAGE = Toolkit.getDefaultToolkit().getImage(ICON);
// 		public static final Image ICON_BUSY_IMAGE = Toolkit.getDefaultToolkit().getImage(ICON_BUSY);
// 	}
// 	
// 	public static class Version {
// 		public static final int MAJOR = 1;
// 		public static final int MINOR = 4;
// 		public static final int PATCH = 9;
// 		
// 		private static String versionString = null;
// 		
// 		public static String getVersionString() {
// 			if(versionString == null) {
// 				// Construct string normally
// 				versionString = MAJOR + "." + MINOR + "." + PATCH;
// 			}
// 			return  versionString;
// 		}
// 	}
// }
// 
// Path: src/org/sleeksnap/Constants.java
// public static class Application {
// 	public static final String NAME = "Sleeksnap";
// 	public static final String URL = "http://sleeksnap.com";
// 	public static final String UPDATE_URL = "http://sleeksnap.com/build/";
// }
// 
// Path: src/org/sleeksnap/Constants.java
// public static class Version {
// 	public static final int MAJOR = 1;
// 	public static final int MINOR = 4;
// 	public static final int PATCH = 9;
// 		
// 	private static String versionString = null;
// 		
// 	public static String getVersionString() {
// 		if(versionString == null) {
// 			// Construct string normally
// 			versionString = MAJOR + "." + MINOR + "." + PATCH;
// 		}
// 		return  versionString;
// 	}
// }


// Path: src/org/sleeksnap/util/Util.java
import org.sleeksnap.Constants;
import org.sleeksnap.Constants.Application;
import org.sleeksnap.Constants.Version;
import java.awt.Desktop;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.swing.JFrame;
import javax.swing.UIManager;

/**
 * Sleeksnap, the open source cross-platform screenshot uploader
 * Copyright (C) 2012 Nikki <nikki@nikkii.us>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.sleeksnap.util;




/**
 * A basic utility class
 * 
 * @author Nikki
 * 
 */
public class Util {
	/**
	 * An enum containing operating system types
	 * 
	 * @author Nikki
	 * 
	 */
	public static enum OperatingSystem {
		LINUX, SOLARIS, WINDOWS, MAC, UNKNOWN
	}

	/**
	 * The cached operating system
	 */
	public static final OperatingSystem SYSTEM = getPlatform();

	/**
	 * The saved working directory
	 */
	private static File workDir;

	/**
	 * A method to get the unix time...
	 * @return
	 * 		The current time in seconds
	 */
	public static long currentTimeSeconds() {
		return (System.currentTimeMillis() / 1000);
	}

	/**
	 * Get the last part of a class name
	 * 
	 * @param key
	 *            The full name
	 * @return The class name formatted
	 */
	public static String formatClassName(Class<?> key) {
		return key.getName().substring(key.getName().lastIndexOf('.') + 1);
	}

	/**
	 * Get the computer's user agent
	 * 
	 */
	public static String getHttpUserAgent() {
		return Application.NAME + " v" + Version.getVersionString();