com.google.gwt.resources.rebind.context
Class MhtmlResourceContext

java.lang.Object
  extended by com.google.gwt.resources.rebind.context.AbstractResourceContext
      extended by com.google.gwt.resources.rebind.context.MhtmlResourceContext
All Implemented Interfaces:
ResourceContext

public class MhtmlResourceContext
extends AbstractResourceContext

Encodes resources into Multipart HTML files. In order to avoid mixed-content warnings using the mhtml: protocol, this context will include a fallback to static files when the module has been loaded from an https source.

See Also:
"RFC 2557"

Method Summary
 java.lang.String deploy(java.lang.String suggestedFileName, java.lang.String mimeType, byte[] data, boolean xhrCompatible)
          Cause a specific collection of bytes to be available in the program's compiled output.
 void finish()
           
 boolean supportsDataUrls()
          Indicates if the runtime context supports data: urls.
 
Methods inherited from class com.google.gwt.resources.rebind.context.AbstractResourceContext
deploy, getCachedData, getClientBundleType, getGeneratorContext, getImplementationSimpleSourceName, putCachedData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deploy

public java.lang.String deploy(java.lang.String suggestedFileName,
                               java.lang.String mimeType,
                               byte[] data,
                               boolean xhrCompatible)
                        throws UnableToCompleteException
Description copied from interface: ResourceContext
Cause a specific collection of bytes to be available in the program's compiled output. The return value of this method is a Java expression which will evaluate to the location of the resource at runtime. The exact format should not be depended upon.

Specified by:
deploy in interface ResourceContext
Parameters:
suggestedFileName - an unobfuscated filename to possibly use for the resource
mimeType - the MIME type of the data being provided
data - the bytes to add to the output
xhrCompatible - enforces compatibility with security restrictions if the resource is intended to be accessed via an XMLHttpRequest.
Returns:
a Java expression which will evaluate to the location of the provided resource at runtime.
Throws:
UnableToCompleteException

finish

public void finish()
            throws UnableToCompleteException
Throws:
UnableToCompleteException

supportsDataUrls

public boolean supportsDataUrls()
Description copied from interface: ResourceContext
Indicates if the runtime context supports data: urls. When data URLs are supported by the context, aggregation of resource data into larger payloads is discouraged, as it offers reduced benefit to the application at runtime.