google-code-export / mgwt

Automatically exported from code.google.com/p/mgwt
Other
1 stars 0 forks source link

HTML5 Manifest Problem #318

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure GWT module xml using the linker "permutationmaplinker"
2. If there is a file name with space in the module, ex. "warn copy.png" in the 
module public folder
3. Compiler will generate manifest file like below

CACHE MANIFEST
# GWT compiled files
OfflineApp/sc/skins/Enterprise/images/Dialog/warn copy.png

4. Browser will not cache the file, because of 404 
"OfflineApp/sc/skins/Enterprise/images/Dialog/warn" not found

What version of the product are you using? On what operating system?
mgwt 1.2.2
Mac OS

Please provide any additional information below.
This problem solved by following code by using URLEncoder:

protected Set<String> getArtifactsForCompilation(TreeLogger logger, 
LinkerContext context, ArtifactSet artifacts) {
    Set<String> artifactNames = new HashSet<String>();
    for (EmittedArtifact artifact : artifacts.find(EmittedArtifact.class)) {
      String pathName = artifact.getPartialPath();

      // 2013-12-16 Cloude URLEncoding
      String[] pathNameArr = pathName.split("/");
      StringBuilder stringBuilder = new StringBuilder();
      for (String value : pathNameArr) {
          try {
              String newValue = URLEncoder.encode(value, "UTF-8");
              newValue = newValue.replace("+", "%20");

              stringBuilder.append(newValue).append("/");
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          }
      }
      String newPathName = stringBuilder.toString();
      newPathName = newPathName.substring(0, newPathName.length()-1);

      if (shouldArtifactBeInManifest(pathName)) {
          artifactNames.add(context.getModuleName() + "/" + newPathName);
      }
    }

Original issue reported on code.google.com by maxclo...@gmail.com on 17 Dec 2013 at 2:47

Attachments:

GoogleCodeExporter commented 9 years ago
Updated code had been pushed to the clone project: 
https://code.google.com/r/maxcloude-mgwt/source/list

Original comment by maxclo...@gmail.com on 17 Dec 2013 at 6:23

GoogleCodeExporter commented 9 years ago
Moved to https://github.com/mgwt/mgwt/issues/10

Original comment by kurka.da...@gmail.com on 13 Jul 2014 at 5:10