Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1008

Google storage provider cannot retrieve "foo/bar"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.9.0, 1.9.1, 2.0.0
    • 2.0.0
    • None

    Description

      The Google cloud storage provider can PUT, but not GET a blob containing "/" in its name. When attempting to retrieve "foo/bar", null is always returned.

      The reason for this behavior is twofold. First, Google expects "/" in the path parameters to be percent-encoded. Secondly, jclouds-core does not have a way to express that a specific path parameter should be encoded prior to being added to the path.

      Currently, the rest processor does the following for the endpoint: assemble all of the tokens together and call

      urlEncode()

      on the result. When it does so, it also skips encoding any "/" characters. If an encoded token is passed to the processor, it ends up being encoded twice, as the "%" character is encoded as %25.

      jclouds-core should add

      @Encoded

      parameter annotation, which would encode each parameter individually (including any "/" characters) before assembling the URL. In this case, the consumers of the API must make sure that they do not need the entire path to be encoded.

      I plan to submit a PR to add the annotation and to use it in the google-cloud-storage provider. When the annotation is not used, endpoints will be processed as is.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              timuralp Timur Alperovich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: