@@ -0,0 +1,1940 @@
+/*%0A * Info.java%0A *%0A * Created on September 1, 2015, 10:38 AM%0A */%0A%0Apackage xal;%0A%0Aimport xal.tools.ResourceManager;%0Aimport xal.tools.coding.json.JSONCoder;%0A%0Aimport java.util.*;%0Aimport java.net.*;%0Aimport java.io.*;%0A%0A%0A/**%0A * Info about the current Open XAL.%0A */%0Apublic class Info %7B%0A%09/** Label for this version of Open XAL */%0A%09final private static String LABEL;%0A%0A%0A%09// static initializer%0A%09static %7B%0A%09%09// assign the default label%0A%09%09String label = %22Open XAL%22;%0A%0A%09%09// attempt to load info properties from the %22info.json%22 file%0A%09%09System.out.println( %22Getting info resource...%22 );%0A%09%09final URL infoLocation = ResourceManager.getResourceURL( Info.class, %22info.json%22 );%0A%09%09if ( infoLocation != null ) %7B%0A%09%09%09try %7B%0A%09%09%09%09//System.out.println( %22Attempting to load Info from URL: %22 + infoLocation );%0A%09%09%09%09final StringBuffer buffer = new StringBuffer();%0A%09%09%09%09final InputStream infoStream = infoLocation.openStream();%0A%09%09%09%09final BufferedReader infoReader = new BufferedReader( new InputStreamReader( infoStream ) );%0A%09%09%09%09while( true ) %7B%0A%09%09%09%09%09final String nextLine = infoReader.readLine();%0A%09%09%09%09%09if ( nextLine != null ) %7B%0A%09%09%09%09%09%09buffer.append( nextLine );%0A%09%09%09%09%09%09buffer.append( %22%5Cn%22 );%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09break;%09// end of input%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09infoStream.close();%0A%0A%09%09%09%09//System.out.println( %22Buffer: %22 + buffer.toString() );%0A%0A%09%09%09%09@SuppressWarnings(%22unchecked%22)%0A%09%09%09%09final Map%3CString,Object%3E infoMap = (Map%3CString,Object%3E)JSONCoder.defaultDecode( buffer.toString() );%0A%09%09%09%09%0A%09%09%09%09//System.out.println( %22Info map: %22 + infoMap );%0A%0A%09%09%09%09label = (String)infoMap.get(%22label%22);%0A%09%09%09%7D catch( Exception exception ) %7B%0A%09%09%09%09System.err.println( %22Exception attempting to load Open XAL info from: %22 + infoLocation );%0A%09%09%09%09exception.printStackTrace();%0A%09%09%09%09System.err.println( %22Will revert to default info label: %22 + label );%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09// assign the Info propreties%0A%09%09LABEL = label;%0A%09%7D%0A%0A%0A%09/** Get the label for this version of Open XAL */%0A%09static public String getLabel() %7B%0A%09%09return LABEL;%0A%09%7D%0A%7D%0A

Add an Info class to provide generic info about Open XAL. Currently we just support a label.