diff options
author | Jihoon Song <jihoon80.song@samsung.com> | 2014-07-14 18:55:46 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2014-07-14 18:55:46 -0700 |
commit | f63af93fd306ae3c3f58a618632095f7818a6c7f (patch) | |
tree | 36899a518d9a07096ff910b9f6f4c151c0d58a0b | |
parent | 8ed24d3dae0ee99f9a413841583a2f6a7f4b02af (diff) | |
parent | 78851359350168e48d5e4d70a0e13b34a0ef3a1f (diff) | |
download | common-eplugin-f63af93fd306ae3c3f58a618632095f7818a6c7f.tar.gz common-eplugin-f63af93fd306ae3c3f58a618632095f7818a6c7f.tar.bz2 common-eplugin-f63af93fd306ae3c3f58a618632095f7818a6c7f.zip |
Merge "SIGN: Fixed Unicode problem for special characters" into tizen
-rw-r--r-- | org.tizen.common.sign/src/org/tizen/common/sign/model/ResolverCustomResource.java | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/org.tizen.common.sign/src/org/tizen/common/sign/model/ResolverCustomResource.java b/org.tizen.common.sign/src/org/tizen/common/sign/model/ResolverCustomResource.java index cf9e895d7..c97d6f57e 100644 --- a/org.tizen.common.sign/src/org/tizen/common/sign/model/ResolverCustomResource.java +++ b/org.tizen.common.sign/src/org/tizen/common/sign/model/ResolverCustomResource.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.commons.httpclient.util.URIUtil; import org.apache.xml.security.signature.XMLSignatureInput; import org.apache.xml.security.utils.resolver.ResourceResolverException; import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem; @@ -163,7 +164,7 @@ public class ResolverCustomResource extends ResolverLocalFilesystem { InputStream is = null; try { final URL url = new URL( new URL( baseURI ), value ); - String escapedUnicode = translateUriToFilename( value ); + String escapedUnicode = URIUtil.decode( value ); if ( this.isMap.containsKey( escapedUnicode ) ) { // a mapped resource for input stream @@ -197,29 +198,4 @@ public class ResolverCustomResource extends ResolverLocalFilesystem { private InputStream openStream(URL url) throws IOException { return new ByteArrayInputStream( IOUtil.getBytes( url.openStream(), true ) ); } - - private String translateUriToFilename(String uri) { - final String SPACE_UNICODE = "%20"; - - if( uri.indexOf( SPACE_UNICODE ) > -1 ) { - int offset = 0; - int index = 0; - StringBuilder temp = new StringBuilder( uri.length() ); - - do { - index = uri.indexOf( SPACE_UNICODE, offset ); - if ( index == -1 ) { - temp.append( uri.substring( offset ) ); - } else { - temp.append( uri.substring( offset, index ) ); - temp.append( ' ' ); - offset = index + SPACE_UNICODE.length(); - } - } while( index != -1 ); - - uri = temp.toString(); - } - - return uri; - } } |