agave-common/common-legacy-api/src/main/java/org/iplantc/service/common/representation/ContextTemplateLoader.java
/**
     * Finds the object that acts as the source of the template with the given
     * name.
     *
     * @param name
     *            The template name.
     * @return The template source {@link Representation}.
     */
Finds the object that acts as the source of the template with the given
name.

@param name
The template name.
@return The template source  Representation.
Finds the object that acts as the source of the template with the given name . @param name The template name . @return The template source Representation .
public Object findTemplateSource(String name) throws IOException {
        StringWriter writer = new StringWriter();
        InputStream in = null;
        try {
        	in = this.getClass().getClassLoader().getResourceAsStream(name);
        	if (in == null) {
        		return null;
        	} else {
	        	IOUtils.copy(in, writer, "utf-8");
	        	return new StringRepresentation(writer.toString());
        	}
        }
        finally {
        	if (in != null) try { in.close(); } catch (Exception e) {}
        	try { writer.close(); } catch (Exception e) {}
        }
    }
public Object findTemplateSource ( String name ) throws IOException { StringWriter writer = new StringWriter ( ) ; InputStream in = null ; try { in = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( name ) ; if ( in == null ) { return null ; } else { IOUtils . copy ( in , writer , "utf-8" ) ; return new StringRepresentation ( writer . toString ( ) ) ; } } finally { if ( in != null ) try { in . close ( ) ; } catch ( Exception e ) { } try { writer . close ( ) ; } catch ( Exception e ) { } } }
Finds the object that acts as the source of the template with the given
 name.
Finds the object that acts as the source of the template with the given name .