java.net.URLDecoder



API Populatity

135 Client projects

Project: java

Package: java.net

Project orientechnologies/orientdb in file ...tp.command.get.OServerCommandGetStaticContent.java (2013-02-07)
@@ -21,6 +21,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URLDecoder;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -146,6 +147,8 @@ public class OServerCommandGetStaticContent extends OServerCommandConfigurableAb
           path = rootPath + url;
       }
 
+      path = URLDecoder.decode(path, "UTF-8");
+
       if (cacheContents != null) {
         synchronized (cacheContents) {
           final OStaticContentCachedEntry cachedEntry = cacheContents.get(path);
Project opentripplanner/OpenTripPlanner in file ...planner.graph_builder.impl.osm.TestUnroutable.java (2014-11-02)
@@ -29,6 +29,7 @@ import org.opentripplanner.routing.spt.ShortestPathTree;
 
 import java.io.File;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.util.HashMap;
 
 /**
@@ -48,7 +49,7 @@ public class TestUnroutable extends TestCase {
         osmBuilder.setDefaultWayPropertySetSource(new DefaultWayPropertySetSource());
         AnyFileBasedOpenStreetMapProviderImpl provider = new AnyFileBasedOpenStreetMapProviderImpl();
         URL osmDataUrl = getClass().getResource("bridge_construction.osm.pbf");
-        File osmDataFile = new File(osmDataUrl.getFile());
+        File osmDataFile = new File(URLDecoder.decode(osmDataUrl.getFile(), "UTF-8"));
         provider.setPath(osmDataFile);
         osmBuilder.setProvider(provider);
         HashMap<Class<?>, Object> extra = Maps.newHashMap();
Project owncloud/android in file ...fzero.owncloud.ui.adapter.FileListListAdapter.java (2012-05-26)
@@ -17,6 +17,7 @@
  */
 package eu.alefzero.owncloud.ui.adapter;
 
+import java.net.URLDecoder;
 import java.util.Vector;
 
 import eu.alefzero.owncloud.DisplayUtils;
@@ -102,7 +103,7 @@ public class FileListListAdapter implements ListAdapter {
             TextView fileName = (TextView) view.findViewById(R.id.Filename);
             String name = file.getFileName();
 
-            fileName.setText(DisplayUtils.HtmlDecode(name));
+            fileName.setText(URLDecoder.decode(name));
             ImageView fileIcon = (ImageView) view.findViewById(R.id.imageView1);
             if (!file.getMimetype().equals("DIR")) {
                 fileIcon.setImageResource(R.drawable.file);