List of usage examples for com.google.gwt.core.ext.linker PublicResource getContents
public abstract InputStream getContents(TreeLogger logger) throws UnableToCompleteException;
From source file:com.bedatadriven.rebar.appcache.linker.AppCacheIFrameLinker.java
License:Apache License
private StringBuffer readManifestTemplate(TreeLogger logger, PermutationContext context, String suffix) throws UnableToCompleteException { // first try to find a template provided in the module's public // folder//from w w w .j a v a 2s .c o m for (PublicResource artifact : context.find(PublicResource.class)) { if (artifact.getPartialPath().equals(context.getModuleName() + "." + suffix)) { return readAll(logger, artifact.getContents(logger)); } } String defaultTemplate = "Default." + suffix; InputStream defaultIn = getClass().getResourceAsStream(defaultTemplate); if (defaultIn == null) { logger.log(TreeLogger.Type.ERROR, "Could not read default '" + defaultTemplate + "'"); throw new UnableToCompleteException(); } return readAll(logger, defaultIn); }