1 | String formCreated() {↵ | | 1 | String formUnautorized() {↵
|
2 | return formError("201 Created", "Object was created");↵ | | 2 | return formError("401 ↵
|
3 | }↵ | | |
|
|
4 | /**↵ | | |
|
5 | * Indicates the document was accepted↵ | | 3 | Unathorized", "Unathorized use of this service");↵
|
| | | 4 | }↵
|
|
| | | 5 | /**↵
|
6 | .↵ | | 6 | * Payment is required for service.↵
|
7 | * ↵ | | 7 | * ↵
|
8 | * @return The header in a string;↵ | | 8 | * @return The header in a string;↵
|
9 | */↵ | | 9 | */↵
|
10 | public static String formAccepted() {↵ | | 10 | public static String formPaymentNeeded() {↵
|
11 | return formError("202 Accepted", "Object checked in");↵ | | 11 | return formError("402 ↵
|
12 | }↵ | | |
|
|
13 | /**↵ | | |
|
14 | * Indicates only a partial responce was sent↵ | | 12 | Payment required", "Payment is required");↵
|
| | | 13 | }↵
|
|
| | | 14 | /**↵
|
15 | .↵ | | 15 | * Client if forbidden to get the request service.↵
|
16 | * ↵ | | 16 | * ↵
|
17 | * @return The header in a string;↵ | | 17 | * @return The header in a string;↵
|
18 | */↵ | | 18 | */↵
|
19 | public static String formPartial() {↵ | | 19 | public static String formForbidden() {↵
|
20 | return formError("203 Partial", "Only partail document available");↵ | | 20 | return formError("403 Forbidden", "You need permission for this service");↵
|
21 | }↵ | | 21 | }↵
|
|
22 | /**↵ | | 22 | /**↵
|
23 | * Indicates a requested URL has moved to a new address or name.↵ | | 23 | * The requested object was not found.↵
|
24 | * ↵ | | 24 | * ↵
|
25 | * @return The header in a string;↵ | | 25 | * @return The header in a string;↵
|
26 | */↵ | | 26 | */↵
|
27 | public static String formMoved() {↵ | | 27 | public static String formNotFound() {↵
|
28 | // 300 codes tell client to do actions↵ | | 28 | ↵
|
29 | return formError("301 Moved", "File has moved");↵ | | |
|
30 | }↵ | | |
|
|
31 | /**↵ | | |
|
32 | * Never seen this used↵ | | 29 | return formError("404 Not_found", "Requested object was not found");↵
|
| | | 30 | }↵
|
|
| | | 31 | /**↵
|
33 | .↵ | | 32 | * The server had a problem and could not fulfill the request.↵
|
34 | * ↵ | | 33 | * ↵
|
35 | * @return The header in a string;↵ | | 34 | * @return The header in a string;↵
|
36 | */↵ | | 35 | */↵
|
37 | public static String formFound() {↵ | | 36 | public static String formInternalError() {↵
|
38 | return formError("302 Found", "Object was found");↵ | | 37 | return formError("↵
|
39 | }↵ | | |
|
|
40 | /**↵ | | |
|
41 | * The requested method is not implemented by the server↵ | | 38 | 500 Internal server error", "Server broke");↵
|
| | | 39 | }↵
|
|
| | | 40 | /**↵
|
42 | .↵ | | 41 | * Server does not do the requested feature.↵
|
43 | * ↵ | | 42 | * ↵
|
44 | * @return The header in a string;↵ | | 43 | * @return The header in a string;↵
|
45 | */↵ | | 44 | */↵
|
46 | public static String formMethod() {↵ | | 45 | public static String formNotImplemented() {↵
|
47 | return formError("303 Method unseported", "Method unseported");↵ | | 46 | return formError("501 Method ↵
|
48 | }↵ | | |
|
|
49 | /**↵ | | |
|
50 | * Indicates remote copy of the requested object is current↵ | | 47 | not implemented", "Service not implemented");↵
|
| | | 48 | }↵
|
|
| | | 49 | /**↵
|
51 | .↵ | | 50 | * Server is overloaded, client should try again latter.↵
|
52 | * ↵ | | 51 | * ↵
|
53 | * @return The header in a string;↵ | | 52 | * @return The header in a string;↵
|
54 | */↵ | | 53 | */↵
|
55 | public static String formNotModified() {↵ | | 54 | public static String formOverloaded() {↵
|
56 | return formError("304 Not modified", "Use local copy");↵ | | 55 | return formError("↵
|
57 | }↵ | | |
|
|
58 | /**↵ | | |
|
59 | * Client not otherized for the request↵ | | 56 | 502 Server overloaded", "Try again latter");↵
|
| | | 57 | }↵
|
|
| | | 58 | /**↵
|
60 | .↵ | | 59 | * Indicates the request took to long.↵
|
61 | * ↵ | | 60 | * ↵
|
62 | * @return The header in a string;↵ | | 61 | * @return The header in a string;↵
|
63 | */↵ | | 62 | */↵
|
64 | public static String formUnautorized() {↵ | | 63 | public static String formTimeout() {↵
|
65 | return formError("401 Unathorized", "Unathorized use of this service");↵ | | 64 | return formError("↵
|
66 | }↵ | | |
|
|
67 | /**↵ | | |
|
68 | * Payment is required for↵ | | 65 | 503 Gateway timeout", "The connection timed out");↵
|
| | | 66 | }↵
|
|
| | | 67 | /**↵
|
69 | service.↵ | | 68 | * Indicates the client's proxies could not locate a server.↵
|
70 | * ↵ | | 69 | * ↵
|
71 | * @return The header in a string;↵ | | 70 | * @return The header in a string;↵
|
72 | */↵ | | 71 | */↵
|
73 | public static String formPaymentNeeded() {↵ | | 72 | public static String formServerNotFound() {↵
|
74 | return formError("402 Payment required", "Payment is required");↵ | | 73 | return formError("503 Gateway timeout", "The requested server was not found");↵
|
75 | }↵ | | 74 | }↵
|
|
76 | /**↵ | | 75 | /**↵
|
77 | * Client if forbidden to get the request service.↵ | | 76 | * Indicates the client is not allowed to access the object.↵
|
78 | * ↵ | | 77 | * ↵
|
79 | * @return The header in a string;↵ | | 78 | * @return The header in a string;↵
|
80 | */↵ | | 79 | */↵
|
81 | public static String formForbidden() {↵ | | 80 | public static String formNotAllowed() {↵
|
82 | return formError("403 Forbidden", "You need permission for this service");↵ | | 81 | return formError("403 Access Denied", "Access is not allowed");↵
|
83 | } | | 82 | }
|