import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.util.HashSet;
import java.util.zip.CRC32;
public class Utils {
+ private static File lastLoadedFile;
+ private static final String UTF_8 = "UTF-8";
+
+ private static BufferedImage lastLoadedBufferedImage;
+
/**
* Load image into {@link BufferedImage} and return it. Caches last loaded
* image to speed up subsequent loading attempts.
return isMevizFile;
}
- private static File lastLoadedFile;
-
- private static BufferedImage lastLoadedBufferedImage;
-
+ public static String urlEncode(String string) {
+ try {
+ return URLEncoder.encode(string, UTF_8).replace("+", "%20");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
}