Wednesday, April 28, 2010

Re: cant open base64 encoded pdf files

I've now written a quick'n'dirty patch ;)

works fine for DataResources. :)

### Eclipse Workspace Patch 1.0
#P GWT_SOURCE
Index: user/src/com/google/gwt/resources/client/ClientBundle.java
===================================================================
--- user/src/com/google/gwt/resources/client/ClientBundle.java
(revision 7991)
+++ user/src/com/google/gwt/resources/client/ClientBundle.java
(working copy)
@@ -37,9 +37,13 @@
* Specifies the classpath location of the resource or resources
associated
* with the {@link ResourcePrototype}.
*/
- @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Source {
String[] value();
}
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+ public @interface SkipBase64 {
+ }
}
Index: user/src/com/google/gwt/resources/rg/DataResourceGenerator.java
===================================================================
--- user/src/com/google/gwt/resources/rg/DataResourceGenerator.java
(revision 7991)
+++ user/src/com/google/gwt/resources/rg/DataResourceGenerator.java
(working copy)
@@ -19,6 +19,7 @@
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.JMethod;
import com.google.gwt.resources.client.DataResource;
+import com.google.gwt.resources.client.ClientBundle.SkipBase64;
import com.google.gwt.resources.ext.AbstractResourceGenerator;
import com.google.gwt.resources.ext.ResourceContext;
import com.google.gwt.resources.ext.ResourceGeneratorUtil;
@@ -45,7 +46,12 @@
}

URL resource = resources[0];
- String outputUrlExpression = context.deploy(resource, false);
+ String outputUrlExpression;
+ if (method.getAnnotation(SkipBase64.class) != null) {
+ outputUrlExpression = context.deploy(resource, true);
+ } else {
+ outputUrlExpression = context.deploy(resource, false);
+ }

SourceWriter sw = new StringSourceWriter();
// Write the expression to create the subtype.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate