import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
-import java.io.*;
-import java.net.URLEncoder;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
import java.util.HashSet;
import java.util.zip.CRC32;
return isMevizFile;
}
+ /**
+ * TODO: URL path component is encoded differently from URL query parameter.
+ * Also some URL encoding might work for HTML on local filesystem, while other
+ * stuff works for web. Things must be cleared up here. Currently they are mixed and
+ * hacked together.
+ */
public static String urlEncode(String string) {
if (string.startsWith("./"))
string = string.substring(2);
- try {
- return URLEncoder.encode(string, UTF_8).replace("+", "%20");
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
+ // TODO: get rid of UrlParamEncoder.
+ return UrlParamEncoder.encode(string);
+ //
+// try {
+// return URLEncoder.encode(string, UTF_8).replace("+", "%20");
+// } catch (UnsupportedEncodingException e) {
+// throw new RuntimeException(e);
+// }
}
}