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