import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
protected Response getCover(String uri, WLoginResult login)
throws IOException {
String[] uriParts = uri.split("/");
+ int startAt = 0;
int off = 2; // "" and "cover"
+ for (int i = 0; i < off; i++) {
+ startAt += uriParts[i].length() + "/".length();
+ }
if (uriParts.length < off + 2) {
return NanoHTTPD.newFixedLengthResponse(Status.BAD_REQUEST,
}
String type = uriParts[off + 0];
- String id = URLDecoder.decode(uriParts[off + 1], "UTF-8");
+ String id = uri.substring(startAt + type.length() + "/".length());
InputStream in = null;
throws IOException {
String[] uriParts = uri.split("/");
int off = 2; // "" and "cover"
+ int startAt = 0;
+ for (int i = 0; i < off; i++) {
+ startAt += uriParts[i].length() + "/".length();
+ }
if (uriParts.length < off + 2) {
return NanoHTTPD.newFixedLengthResponse(Status.BAD_REQUEST,
}
String type = uriParts[off + 0];
- String id = URLDecoder.decode(uriParts[off + 1], "UTF-8");
+ String id = uri.substring(startAt + type.length() + "/".length());
if ("source".equals(type)) {
sourceCover(id, login, luid);