The code was very intersting but I need to refactor a bit and I'd like to add some "utility" method.
Also I added a way to automatically invalidate old Auth token and get a new one.
My code (very alpha... I'm still working on it...) is here:
http://code.google.com/p/fhpublicstuff/source/browse/test/GAEConnector/GAEConnector.java
[Update: it manages http and https connections to GAE]
Usage:
// ....
_gaeConnector = new GAEConnector(null, "http://AAAAAAAA.appspot.com");
if (!_gaeConnector.Authenticate(MyTest.this)) {
message = "***AUTHENTICATION ERROR***";
}
// .....
if (_gaeConnector.isAuthenticated()) {
int httpStatusCode = _gaeConnector.GETContent("/myurl", true, true);
if (httpStatusCode == 200) {
String content = _gaeConnector.getLastContent();
// ....
Nessun commento:
Posta un commento