wasDAVClient – Diff between revs 5 and 7
?pathlinks?
Rev 5 | Rev 7 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | /////////////////////////////////////////////////////////////////////////// |
1 | /////////////////////////////////////////////////////////////////////////// |
|
2 | // Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // |
2 | // Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // |
|
3 | // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
3 | // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
|
4 | // rights of fair usage, the disclaimer and warranty conditions. // |
4 | // rights of fair usage, the disclaimer and warranty conditions. // |
|
5 | /////////////////////////////////////////////////////////////////////////// |
5 | /////////////////////////////////////////////////////////////////////////// |
|
6 | // Originally based on: WebDAV .NET client by Sergey Kazantsev |
6 | // Originally based on: WebDAV .NET client by Sergey Kazantsev |
|
7 | |
7 | |
|
8 | using System; |
8 | using System; |
|
9 | using System.Runtime.Serialization; |
9 | using System.Runtime.Serialization; |
|
10 | using System.Text; |
10 | using System.Text; |
|
11 | using System.Web; |
11 | using System.Web; |
|
12 | |
12 | |
|
13 | namespace wasDAVClient.Helpers |
13 | namespace wasDAVClient.Helpers |
|
14 | { |
14 | { |
|
15 | public class wasDAVException : HttpException |
15 | public class wasDAVException : HttpException |
|
16 | { |
16 | { |
|
17 | public wasDAVException() |
17 | public wasDAVException() |
|
18 | { |
18 | { |
|
19 | } |
19 | } |
|
20 | |
20 | |
|
21 | public wasDAVException(string message) |
21 | public wasDAVException(string message) |
|
22 | : base(message) |
22 | : base(message) |
|
23 | { |
23 | { |
|
24 | } |
24 | } |
|
25 | |
25 | |
|
26 | public wasDAVException(string message, int hr) |
26 | public wasDAVException(string message, int hr) |
|
27 | : base(message, hr) |
27 | : base(message, hr) |
|
28 | { |
28 | { |
|
29 | } |
29 | } |
|
30 | |
30 | |
|
31 | public wasDAVException(string message, Exception innerException) |
31 | public wasDAVException(string message, Exception innerException) |
|
32 | : base(message, innerException) |
32 | : base(message, innerException) |
|
33 | { |
33 | { |
|
34 | } |
34 | } |
|
35 | |
35 | |
|
36 | public wasDAVException(int httpCode, string message, Exception innerException) |
36 | public wasDAVException(int httpCode, string message, Exception innerException) |
|
37 | : base(httpCode, message, innerException) |
37 | : base(httpCode, message, innerException) |
|
38 | { |
38 | { |
|
39 | } |
39 | } |
|
40 | |
40 | |
|
41 | public wasDAVException(int httpCode, string message) |
41 | public wasDAVException(int httpCode, string message) |
|
42 | : base(httpCode, message) |
42 | : base(httpCode, message) |
|
43 | { |
43 | { |
|
44 | } |
44 | } |
|
45 | |
45 | |
|
46 | public wasDAVException(int httpCode, string message, int hr) |
46 | public wasDAVException(int httpCode, string message, int hr) |
|
47 | : base(httpCode, message, hr) |
47 | : base(httpCode, message, hr) |
|
48 | { |
48 | { |
|
49 | } |
49 | } |
|
50 | |
50 | |
|
51 | protected wasDAVException(SerializationInfo info, StreamingContext context) |
51 | protected wasDAVException(SerializationInfo info, StreamingContext context) |
|
52 | : base(info, context) |
52 | : base(info, context) |
|
53 | { |
53 | { |
|
54 | } |
54 | } |
|
55 | |
55 | |
|
56 | public override string ToString() |
56 | public override string ToString() |
|
57 | { |
57 | { |
|
58 | var sb = new StringBuilder(); |
58 | var sb = new StringBuilder(); |
|
59 | sb.Append($"HttpStatusCode: {GetHttpCode()}"); |
59 | sb.Append($"HttpStatusCode: {GetHttpCode()}"); |
|
60 | sb.Append(Environment.NewLine); |
60 | sb.Append(Environment.NewLine); |
|
61 | sb.Append($"ErrorCode: {ErrorCode}"); |
61 | sb.Append($"ErrorCode: {ErrorCode}"); |
|
62 | sb.Append(Environment.NewLine); |
62 | sb.Append(Environment.NewLine); |
|
63 | sb.Append($"Message: {Message}"); |
63 | sb.Append($"Message: {Message}"); |
|
64 | sb.Append(Environment.NewLine); |
64 | sb.Append(Environment.NewLine); |
|
65 | sb.Append(base.ToString()); |
65 | sb.Append(base.ToString()); |
|
66 | |
66 | |
|
67 | return sb.ToString(); |
67 | return sb.ToString(); |
|
68 | } |
68 | } |
|
69 | } |
69 | } |
|
70 | } |
70 | } |
|
71 | |
71 | |