@@ -49,7 +49,7 @@ private static LocalIdManager getLocalIdManager() {
4949 private String installationId ;
5050 public String masterKey ;
5151
52- private Method method = Method .GET ;
52+ private ParseHttpRequest . Method method = ParseHttpRequest . Method .GET ;
5353 private String httpPath ;
5454 private JSONObject jsonParameters ;
5555
@@ -73,7 +73,7 @@ public T masterKey(String masterKey) {
7373 return self ();
7474 }
7575
76- public T method (Method method ) {
76+ public T method (ParseHttpRequest . Method method ) {
7777 this .method = method ;
7878 return self ();
7979 }
@@ -121,7 +121,10 @@ public ParseRESTCommand build() {
121121 private String operationSetUUID ;
122122 private String localId ;
123123
124- public ParseRESTCommand (String httpPath , Method httpMethod , Map <String , ?> parameters ,
124+ public ParseRESTCommand (
125+ String httpPath ,
126+ ParseHttpRequest .Method httpMethod ,
127+ Map <String , ?> parameters ,
125128 String sessionToken ) {
126129 this (
127130 httpPath ,
@@ -130,12 +133,18 @@ public ParseRESTCommand(String httpPath, Method httpMethod, Map<String, ?> param
130133 sessionToken );
131134 }
132135
133- protected ParseRESTCommand (String httpPath , Method httpMethod , JSONObject jsonParameters ,
136+ protected ParseRESTCommand (
137+ String httpPath ,
138+ ParseHttpRequest .Method httpMethod ,
139+ JSONObject jsonParameters ,
134140 String sessionToken ) {
135141 this (httpPath , httpMethod , jsonParameters , null , sessionToken );
136142 }
137143
138- private ParseRESTCommand (String httpPath , Method httpMethod , JSONObject jsonParameters ,
144+ private ParseRESTCommand (
145+ String httpPath ,
146+ ParseHttpRequest .Method httpMethod ,
147+ JSONObject jsonParameters ,
139148 String localId , String sessionToken ) {
140149 super (httpMethod , createUrl (httpPath ));
141150
@@ -159,7 +168,8 @@ private ParseRESTCommand(String httpPath, Method httpMethod, JSONObject jsonPara
159168
160169 public static ParseRESTCommand fromJSONObject (JSONObject jsonObject ) {
161170 String httpPath = jsonObject .optString ("httpPath" );
162- Method httpMethod = Method .fromString (jsonObject .optString ("httpMethod" ));
171+ ParseHttpRequest .Method httpMethod =
172+ ParseHttpRequest .Method .fromString (jsonObject .optString ("httpMethod" ));
163173 String sessionToken = jsonObject .optString ("sessionToken" , null );
164174 String localId = jsonObject .optString ("localId" , null );
165175 JSONObject jsonParameters = jsonObject .optJSONObject ("parameters" );
@@ -192,17 +202,17 @@ protected void addAdditionalHeaders(ParseHttpRequest.Builder requestBuilder) {
192202
193203 @ Override
194204 protected ParseHttpRequest newRequest (
195- Method method ,
205+ ParseHttpRequest . Method method ,
196206 String url ,
197207 ProgressCallback uploadProgressCallback ) {
198208 ParseHttpRequest request ;
199209 if (jsonParameters != null &&
200- method != Method .POST &&
201- method != Method .PUT ) {
210+ method != ParseHttpRequest . Method .POST &&
211+ method != ParseHttpRequest . Method .PUT ) {
202212 // The request URI may be too long to include parameters in the URI.
203213 // To avoid this problem we send the parameters in a POST request json-encoded body
204214 // and add a http method override parameter in newBody.
205- request = super .newRequest (Method .POST , url , uploadProgressCallback );
215+ request = super .newRequest (ParseHttpRequest . Method .POST , url , uploadProgressCallback );
206216 } else {
207217 request = super .newRequest (method , url , uploadProgressCallback );
208218 }
@@ -221,8 +231,8 @@ protected ParseHttpBody newBody(ProgressCallback uploadProgressCallback) {
221231
222232 try {
223233 JSONObject parameters = jsonParameters ;
224- if (method == Method .GET ||
225- method == Method .DELETE ) {
234+ if (method == ParseHttpRequest . Method .GET ||
235+ method == ParseHttpRequest . Method .DELETE ) {
226236 // The request URI may be too long to include parameters in the URI.
227237 // To avoid this problem we send the parameters in a POST request json-encoded body
228238 // and add a http method override parameter.
@@ -421,8 +431,8 @@ private void maybeChangeServerOperation() throws JSONException {
421431 httpPath += String .format ("/%s" , objectId );
422432 url = createUrl (httpPath );
423433
424- if (httpPath .startsWith ("classes" ) && method == Method .POST ) {
425- method = Method .PUT ;
434+ if (httpPath .startsWith ("classes" ) && method == ParseHttpRequest . Method .POST ) {
435+ method = ParseHttpRequest . Method .PUT ;
426436 }
427437 }
428438 }
0 commit comments