package touist;

import java.io.IOException;
import java.util.Properties;

/**
 * Note: to use that class, write:
 * 		private static TouistProperties properties = new TouistProperties();
 * @author maelv
 *
 */
public class TouistProperties {
	private static Properties prop = new Properties();
	public TouistProperties() {
		try {
			prop.load(this.getClass().getClassLoader().getResourceAsStream("version.properties"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
    
	public String getProperty(String property) {
		return prop.getProperty(property);
	}
}

@@ -38,16 +38,44 @@
 eption;%0A
+import java.io.InputStream;%0A
 import j
@@ -361,18 +361,25 @@
 %0A%09%09%09
-prop.load(
+InputStream in = 
 this
@@ -452,98 +452,187 @@
 es%22)
-);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace(
+;%0A%09%09%09if(in == null) throw new IOException();%0A%09%09%09else prop.load(in);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09System.out.println(%22Warning: the property file version.properties was not found%22
 );%0A%09
@@ -694,14 +694,20 @@
 %7B%0A%09%09
-return
+String res =
  pro
@@ -731,13 +731,44 @@
 perty);%0A
+%09%09return (res != null)?res:%22%22;%0A
 %09%7D%0A%7D%0A

Allow running Touist without the version.properties file #90