diff options
author | Jihoon Song <jihoon80.song@samsung.com> | 2014-07-14 16:45:28 +0900 |
---|---|---|
committer | Jihoon Song <jihoon80.song@samsung.com> | 2014-07-14 16:45:28 +0900 |
commit | 78851359350168e48d5e4d70a0e13b34a0ef3a1f (patch) | |
tree | cb4127ad3aced345da245204e867116cc93af8e7 | |
parent | fa8648deac2e76ee53a3015e61c5e90f3b5e6651 (diff) | |
download | common-eplugin-78851359350168e48d5e4d70a0e13b34a0ef3a1f.tar.gz common-eplugin-78851359350168e48d5e4d70a0e13b34a0ef3a1f.tar.bz2 common-eplugin-78851359350168e48d5e4d70a0e13b34a0ef3a1f.zip |
SIGN: Fixed Unicode problem for special characters
Change-Id: I09060b1f0961272363eee282b1bde9ea542abd92
Signed-off-by: Jihoon Song <jihoon80.song@samsung.com>
-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; - } } |