Copyright (c) 2012 CloudMine LLC, http://cloudmine.me
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software")...
If you think the Android project cloudmine-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.cloudmine.api.rest;
/*www.java2s.com*/import com.android.volley.NetworkResponse;
import com.android.volley.Response;
import com.cloudmine.api.JavaAccessListController;
import com.cloudmine.api.CMSessionToken;
import com.cloudmine.api.rest.options.CMServerFunction;
import com.cloudmine.api.rest.response.CreationResponse;
import me.cloudmine.annotations.Expand;
import me.cloudmine.annotations.Optional;
/**
* Create or update an AccessList. Requires a valid CMSessionToken
* <br>Copyright CloudMine LLC. All rights reserved
* <br> See LICENSE file included with SDK for details.
*/publicclass BaseAccessListCreateRequest extends CloudMineRequest<CreationResponse> {
publicstaticfinalint REQUEST_TYPE = 420;
privatestaticfinal String BASE_URL = "/user/access";
/**
* Create a new AccessListCreateRequest for a specific access list
* @param accessList The access list to create
* @param sessionToken a valid session token for the user associated with this access list
* @param serverFunction
* @param successListener
* @param errorListener
*/
@Expand
public BaseAccessListCreateRequest(JavaAccessListController accessList, CMSessionToken sessionToken, @Optional CMServerFunction serverFunction, @Optional Response.Listener<CreationResponse> successListener, @Optional Response.ErrorListener errorListener) {
super(Method.POST, BASE_URL, accessList.transportableRepresentation(), sessionToken, serverFunction, successListener, errorListener);
}
@Override
protected Response<CreationResponse> parseNetworkResponse(NetworkResponse networkResponse) {
return Response.success(new CreationResponse(new String(networkResponse.data), networkResponse.statusCode), getCacheEntry(networkResponse));
}
@Override
publicint getRequestType() {
return REQUEST_TYPE;
}
}