Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1900

Invalid ContentId Encode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.0.10, 2.1.4
    • Core
    • None
    • Linux - Ubuntu 8.04

    Description

      The namespace "urn:ihe:iti:xds-b:2007" is encoded in this way:

      Content-ID: <ae6becb4-dee4-441f-8b21-9cdffe3b2986@urn%3Aihe%3Aiti%3Axds-b%3A2007>

      I change the class AttachmentUtil like this:

      /**

      • @param ns
      • @return
        */
        public static String createContentID(String ns) throws UnsupportedEncodingException {
        // tend to change
        String cid = URLEncoder.encode("http://cxf.apache.org/", "UTF-8");

      String name = UUID.randomUUID().toString();
      if (ns != null && (ns.length() > 0)) {
      try

      { URI uri = new URI(ns); String host = uri.toURL().getHost(); cid = URLEncoder.encode(host, "UTF-8"); }

      catch (URISyntaxException e)

      { e.printStackTrace(); return null; }

      catch (MalformedURLException e)

      { cid = ns; }

      }
      return URLEncoder.encode(name, "UTF-8") + "@" + cid;
      }

      bye

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            andrea.bozzetto Andrea Bozzetto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: