Example usage for com.google.gwt.core.ext.linker PublicResource getPartialPath

List of usage examples for com.google.gwt.core.ext.linker PublicResource getPartialPath

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.linker PublicResource getPartialPath.

Prototype

public final String getPartialPath() 

Source Link

Document

Returns the partial path within the output directory of the EmittedArtifact.

Usage

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// ww w. j av  a 2 s. co 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);
}