Invalid ContentId Encode
------------------------
Key: CXF-1900
URL: https://issues.apache.org/jira/browse/CXF-1900
Project: CXF
Issue Type: Bug
Components: Core
Affects Versions: 2.1.3
Environment: Linux - Ubuntu 8.04
Reporter: Andrea Bozzetto
The namespace "urn:ihe:iti:xds-b:2007" is encoded in this way:
Content-ID: <[EMAIL PROTECTED]>
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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.