// Path: segment/src/main/java/net/loomchild/segment/util/Util.java
// public static Manifest getJarManifest(Class<?> klass) {
//        URL classUrl = klass.getResource(klass.getSimpleName() + ".class");
//        if (classUrl == null) {
//            throw new IllegalArgumentException("Class not found: " + 
//                    klass.getName() + ".");
//        }
//        String classPath = classUrl.toString();
//        int jarIndex = classPath.indexOf('!');
//        if (jarIndex != -1) {
//            String manifestPath = 
//            	classPath.substring(0, jarIndex + 1) + MANIFEST_PATH;
//            try {
//                URL manifestUrl = new URL(manifestPath);
//                InputStream manifestStream = manifestUrl.openStream();
//                Manifest manifest = new Manifest(manifestStream);
//                return manifest;
//            } 
//            catch (IOException e) {
//            	throw new ResourceNotFoundException(
//            			"IO Error retrieving manifest.", e);
//            }
//        }
//        else {
//        	throw new ResourceNotFoundException(
//        			"Class is not in a JAR archive " + klass.getName() + ".");
//        }
//    }


import static net.loomchild.segment.util.Util.getJarManifest;
import java.util.jar.Manifest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
package net.loomchild.segment.util;




/**
 * Retrieves segment version. Singleton.
 * @author loomchild
 */
public class Version {
	
    private static final Log log = LogFactory.getLog(Version.class);
	
	public static final String VERSION_ATTRIBUTE = "Implementation-Version";  
	public static final String DATE_ATTRIBUTE = "Build-Date";  
	
	private static Version instance = new Version();
	
	private String version;

	private String date;
	
	public static Version getInstance() {
		return instance;
	}
	
	private Version() {
		try {
// Path: segment/src/main/java/net/loomchild/segment/util/Util.java
// public static Manifest getJarManifest(Class<?> klass) {
//        URL classUrl = klass.getResource(klass.getSimpleName() + ".class");
//        if (classUrl == null) {
//            throw new IllegalArgumentException("Class not found: " + 
//                    klass.getName() + ".");
//        }
//        String classPath = classUrl.toString();
//        int jarIndex = classPath.indexOf('!');
//        if (jarIndex != -1) {
//            String manifestPath = 
//            	classPath.substring(0, jarIndex + 1) + MANIFEST_PATH;
//            try {
//                URL manifestUrl = new URL(manifestPath);
//                InputStream manifestStream = manifestUrl.openStream();
//                Manifest manifest = new Manifest(manifestStream);
//                return manifest;
//            } 
//            catch (IOException e) {
//            	throw new ResourceNotFoundException(
//            			"IO Error retrieving manifest.", e);
//            }
//        }
//        else {
//        	throw new ResourceNotFoundException(
//        			"Class is not in a JAR archive " + klass.getName() + ".");
//        }
//    }


// Path: segment/src/main/java/net/loomchild/segment/util/Version.java
import static net.loomchild.segment.util.Util.getJarManifest;
import java.util.jar.Manifest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

package net.loomchild.segment.util;




/**
 * Retrieves segment version. Singleton.
 * @author loomchild
 */
public class Version {
	
    private static final Log log = LogFactory.getLog(Version.class);
	
	public static final String VERSION_ATTRIBUTE = "Implementation-Version";  
	public static final String DATE_ATTRIBUTE = "Build-Date";  
	
	private static Version instance = new Version();
	
	private String version;

	private String date;
	
	public static Version getInstance() {
		return instance;
	}
	
	private Version() {
		try {
			Manifest manifest = getJarManifest(Version.class);