blob: 964af5d1e444322d07c3d6617e470a7ad0471970 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package cgeo.geocaching;
import cgeo.geocaching.files.LocalStorage;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import java.io.File;
public class cgDirectionImg {
public static void getDrawable(final String geocode, final String code) {
if (StringUtils.isBlank(geocode) || StringUtils.isBlank(code)) {
return;
}
final HttpResponse httpResponse =
cgBase.request("http://www.geocaching.com/ImgGen/seek/CacheDir.ashx", new Parameters("k", code), false);
if (httpResponse != null) {
LocalStorage.saveEntityToFile(httpResponse.getEntity(), getDirectionFile(geocode));
}
}
public static File getDirectionFile(final String geocode) {
return LocalStorage.getStorageFile(geocode, "direction.png", false);
}
}
|