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