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