Skip to content

Commit 305aa67

Browse files
committed
fleshed out comments
1 parent 29ba1f0 commit 305aa67

File tree

1 file changed

+42
-21
lines changed

1 file changed

+42
-21
lines changed
Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,54 @@
1+
/*
2+
Android Asynchronous Http Client
3+
Copyright (c) 2011 James Smith <[email protected]>
4+
http://loopj.com
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
119
package com.loopj.android.http;
220

321
import java.net.URI;
4-
522
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
623

24+
/**
25+
* The current Android (API level 21) bundled version of the Apache Http Client does not implement
26+
* the HTTP PATCH method. Until the Android version is updated this can serve in it's stead.
27+
* This implementation can and should go away when the official solution arrives.
28+
*/
729
public final class HttpPatch extends HttpEntityEnclosingRequestBase {
830

9-
public final static String METHOD_NAME = "PATCH";
10-
11-
public HttpPatch() {
12-
super();
13-
}
14-
15-
public HttpPatch(final URI uri) {
16-
super();
17-
setURI(uri);
18-
}
19-
20-
/**
21-
* @throws IllegalArgumentException if the uri is invalid.
22-
*/
23-
public HttpPatch(final String uri) {
31+
public final static String METHOD_NAME = "PATCH";
32+
33+
public HttpPatch() {
2434
super();
25-
setURI(URI.create(uri));
2635
}
2736

28-
@Override
29-
public String getMethod() {
30-
return METHOD_NAME;
31-
}
37+
public HttpPatch(final URI uri) {
38+
super();
39+
setURI(uri);
40+
}
3241

42+
/**
43+
* @throws IllegalArgumentException if the uri is invalid.
44+
*/
45+
public HttpPatch(final String uri) {
46+
super();
47+
setURI(URI.create(uri));
48+
}
49+
50+
@Override
51+
public String getMethod() {
52+
return METHOD_NAME;
53+
}
3354
}

0 commit comments

Comments
 (0)