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