fork download
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import static java.lang.System.out;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		out.println(new File("hello+world.txt").toURI().toString());
		out.println(java.net.URLDecoder.decode(new File("hello+world.txt").toURI().toURL().toString()));
		out.println(new File("hello+world.txt").toURI().toString().replaceAll("\\+", "%2B"));
	}
}
Success #stdin #stdout 0.07s 2841600KB
stdin
Standard input is empty
stdout
file:/home/9C6DJW/hello+world.txt
file:/home/9C6DJW/hello world.txt
file:/home/9C6DJW/hello%2Bworld.txt