I have a string representing an URL containing spaces and want to convert it to an URI object. If I simply try to create it via
String myString = \"http://my
URL url = Test.class.getResource(args[0]); // reading demo file path from // same location where class File input=null; try { input = new File(url.toURI()); } catch (URISyntaxException e1) { // TODO Auto-generated catch block e1.printStackTrace(); }