CLI: Get the proper path from URL on windows 32/16032/2
authorshingil.kang <shingil.kang@samsung.com>
Wed, 5 Feb 2014 10:24:56 +0000 (19:24 +0900)
committershingil.kang <shingil.kang@samsung.com>
Wed, 5 Feb 2014 10:31:20 +0000 (19:31 +0900)
when getting path from url, the path was not properly expressed on windows.

Change-Id: I3111f12b36f34c7407c02e4480fc3545c577f181
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateWebProjectCommand.java

index 5e9a4d1..abbc1ac 100644 (file)
@@ -35,9 +35,11 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.List;
@@ -853,7 +855,16 @@ class ProjectGenUtil
 
         String urlPath = url.getPath();
 
-        String templateLibPath = urlPath + File.separator;
+        String templateLibPath;
+
+        try {
+            urlPath = URLDecoder.decode(urlPath, "utf-8");
+            urlPath = new File(urlPath).getPath();
+            templateLibPath = urlPath + File.separator;
+        } catch (UnsupportedEncodingException e) {
+            logger.error("not decode url path", e.getMessage());
+            return null;
+        }
 
         // if the url is not expressed jar file
         if(urlPath.contains("!"))