public String clearCache(){
String url=" http://localhost:8399/arcgis/rest/admin/login?username=arcgis&password=arcgis" +
"&redirect=http://localhost:8399/arcgis/rest/admin/cache/clear";
//构造HttpClient的实例
HttpClient httpClient = new HttpClient();
//创建GET方法的实例
GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
statusCode = httpClient.executeMethod(getMethod);
if (statusCode != HttpStatus.SC_OK) {
return "缓存清除不成功!";
}else{
return "缓存清除成功!" ;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
String url=" http://localhost:8399/arcgis/rest/admin/login?username=arcgis&password=arcgis" +
"&redirect=http://localhost:8399/arcgis/rest/admin/cache/clear";
//构造HttpClient的实例
HttpClient httpClient = new HttpClient();
//创建GET方法的实例
GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
statusCode = httpClient.executeMethod(getMethod);
if (statusCode != HttpStatus.SC_OK) {
return "缓存清除不成功!";
}else{
return "缓存清除成功!" ;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}