Example #1
0
	/**
	 * Returns the licence text.
	 *
	 * @return The licence text is returned.
	 */
	public String getText() {
		try {
			if ( licenceText == null ) {
				licenceText = Resources.loadResourceAsString( licenceTextName ).intern();
			}
		} catch ( IOException e ) {
			throw new RuntimeException( e );
		}
		return licenceText;
	}
Example #2
0
	/**
	 * Initialises the database.
	 */
	static {
		try {
			ObjectMapper om = new ObjectMapper();
			om.configure( JsonParser.Feature.ALLOW_COMMENTS, true );

			String jsonText = Resources.loadResourceAsString( DATABASE_NAME ); // workaround for bug #779, see http://jira.codehaus.org/browse/JACKSON-779
			database = om.readTree( jsonText );
		} catch ( Exception e ) {
			throw new ExceptionInInitializerError( e );
		}
	}