1 package net.sf.gaeappmanager.google.appengine;
2
3 import net.sf.gaeappmanager.google.LogonHelper;
4
5 import org.apache.http.HttpResponse;
6 import org.apache.http.client.methods.HttpGet;
7 import org.apache.http.impl.client.DefaultHttpClient;
8
9
10
11
12
13
14 public class Manager {
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 public static QuotaDetails retrieveAppQuotaDetails(String userid,
32 String password, String source, String application)
33 throws Exception {
34 String authCookie = LogonHelper.loginToGoogleAppEngine(userid,
35 password, source);
36
37 DefaultHttpClient client = new DefaultHttpClient();
38
39 try {
40 HttpGet get = new HttpGet(
41 "https://appengine.google.com/dashboard/quotadetails?&app_id="
42 + application);
43 get.setHeader("Cookie", "ACSID=" + authCookie);
44
45 HttpResponse response = client.execute(get);
46
47 return new QuotaDetailsParser().parse(response.getEntity()
48 .getContent());
49 } finally {
50 client.getConnectionManager().shutdown();
51 }
52 }
53 }