Mercurial > 510Connectbot
comparison src/com/trilead/ssh2/sftp/ErrorCodes.java @ 0:0ce5cc452d02
initial version
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 22 May 2014 10:41:19 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0ce5cc452d02 |
---|---|
1 | |
2 package com.trilead.ssh2.sftp; | |
3 | |
4 /** | |
5 * | |
6 * SFTP Error Codes | |
7 * | |
8 * @author Christian Plattner, plattner@trilead.com | |
9 * @version $Id: ErrorCodes.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $ | |
10 * | |
11 */ | |
12 public class ErrorCodes { | |
13 public static final int SSH_FX_OK = 0; | |
14 public static final int SSH_FX_EOF = 1; | |
15 public static final int SSH_FX_NO_SUCH_FILE = 2; | |
16 public static final int SSH_FX_PERMISSION_DENIED = 3; | |
17 public static final int SSH_FX_FAILURE = 4; | |
18 public static final int SSH_FX_BAD_MESSAGE = 5; | |
19 public static final int SSH_FX_NO_CONNECTION = 6; | |
20 public static final int SSH_FX_CONNECTION_LOST = 7; | |
21 public static final int SSH_FX_OP_UNSUPPORTED = 8; | |
22 public static final int SSH_FX_INVALID_HANDLE = 9; | |
23 public static final int SSH_FX_NO_SUCH_PATH = 10; | |
24 public static final int SSH_FX_FILE_ALREADY_EXISTS = 11; | |
25 public static final int SSH_FX_WRITE_PROTECT = 12; | |
26 public static final int SSH_FX_NO_MEDIA = 13; | |
27 public static final int SSH_FX_NO_SPACE_ON_FILESYSTEM = 14; | |
28 public static final int SSH_FX_QUOTA_EXCEEDED = 15; | |
29 public static final int SSH_FX_UNKNOWN_PRINCIPAL = 16; | |
30 public static final int SSH_FX_LOCK_CONFLICT = 17; | |
31 public static final int SSH_FX_DIR_NOT_EMPTY = 18; | |
32 public static final int SSH_FX_NOT_A_DIRECTORY = 19; | |
33 public static final int SSH_FX_INVALID_FILENAME = 20; | |
34 public static final int SSH_FX_LINK_LOOP = 21; | |
35 public static final int SSH_FX_CANNOT_DELETE = 22; | |
36 public static final int SSH_FX_INVALID_PARAMETER = 23; | |
37 public static final int SSH_FX_FILE_IS_A_DIRECTORY = 24; | |
38 public static final int SSH_FX_BYTE_RANGE_LOCK_CONFLICT = 25; | |
39 public static final int SSH_FX_BYTE_RANGE_LOCK_REFUSED = 26; | |
40 public static final int SSH_FX_DELETE_PENDING = 27; | |
41 public static final int SSH_FX_FILE_CORRUPT = 28; | |
42 public static final int SSH_FX_OWNER_INVALID = 29; | |
43 public static final int SSH_FX_GROUP_INVALID = 30; | |
44 public static final int SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK = 31; | |
45 | |
46 private static final String[][] messages = { | |
47 | |
48 { "SSH_FX_OK", "Indicates successful completion of the operation." }, | |
49 { | |
50 "SSH_FX_EOF", | |
51 "An attempt to read past the end-of-file was made; or, there are no more directory entries to return." | |
52 }, | |
53 { "SSH_FX_NO_SUCH_FILE", "A reference was made to a file which does not exist." }, | |
54 { "SSH_FX_PERMISSION_DENIED", "The user does not have sufficient permissions to perform the operation." }, | |
55 { "SSH_FX_FAILURE", "An error occurred, but no specific error code exists to describe the failure." }, | |
56 { "SSH_FX_BAD_MESSAGE", "A badly formatted packet or other SFTP protocol incompatibility was detected." }, | |
57 { "SSH_FX_NO_CONNECTION", "There is no connection to the server." }, | |
58 { "SSH_FX_CONNECTION_LOST", "The connection to the server was lost." }, | |
59 { | |
60 "SSH_FX_OP_UNSUPPORTED", | |
61 "An attempted operation could not be completed by the server because the server does not support the operation." | |
62 }, | |
63 { "SSH_FX_INVALID_HANDLE", "The handle value was invalid." }, | |
64 { "SSH_FX_NO_SUCH_PATH", "The file path does not exist or is invalid." }, | |
65 { "SSH_FX_FILE_ALREADY_EXISTS", "The file already exists." }, | |
66 { "SSH_FX_WRITE_PROTECT", "The file is on read-only media, or the media is write protected." }, | |
67 { | |
68 "SSH_FX_NO_MEDIA", | |
69 "The requested operation cannot be completed because there is no media available in the drive." | |
70 }, | |
71 { | |
72 "SSH_FX_NO_SPACE_ON_FILESYSTEM", | |
73 "The requested operation cannot be completed because there is insufficient free space on the filesystem." | |
74 }, | |
75 { | |
76 "SSH_FX_QUOTA_EXCEEDED", | |
77 "The operation cannot be completed because it would exceed the user's storage quota." | |
78 }, | |
79 { | |
80 "SSH_FX_UNKNOWN_PRINCIPAL", | |
81 "A principal referenced by the request (either the 'owner', 'group', or 'who' field of an ACL), was unknown. The error specific data contains the problematic names." | |
82 }, | |
83 { "SSH_FX_LOCK_CONFLICT", "The file could not be opened because it is locked by another process." }, | |
84 { "SSH_FX_DIR_NOT_EMPTY", "The directory is not empty." }, | |
85 { "SSH_FX_NOT_A_DIRECTORY", "The specified file is not a directory." }, | |
86 { "SSH_FX_INVALID_FILENAME", "The filename is not valid." }, | |
87 { | |
88 "SSH_FX_LINK_LOOP", | |
89 "Too many symbolic links encountered or, an SSH_FXF_NOFOLLOW open encountered a symbolic link as the final component." | |
90 }, | |
91 { | |
92 "SSH_FX_CANNOT_DELETE", | |
93 "The file cannot be deleted. One possible reason is that the advisory READONLY attribute-bit is set." | |
94 }, | |
95 { | |
96 "SSH_FX_INVALID_PARAMETER", | |
97 "One of the parameters was out of range, or the parameters specified cannot be used together." | |
98 }, | |
99 { | |
100 "SSH_FX_FILE_IS_A_DIRECTORY", | |
101 "The specified file was a directory in a context where a directory cannot be used." | |
102 }, | |
103 { | |
104 "SSH_FX_BYTE_RANGE_LOCK_CONFLICT", | |
105 " A read or write operation failed because another process's mandatory byte-range lock overlaps with the request." | |
106 }, | |
107 { "SSH_FX_BYTE_RANGE_LOCK_REFUSED", "A request for a byte range lock was refused." }, | |
108 { "SSH_FX_DELETE_PENDING", "An operation was attempted on a file for which a delete operation is pending." }, | |
109 { "SSH_FX_FILE_CORRUPT", "The file is corrupt; an filesystem integrity check should be run." }, | |
110 { "SSH_FX_OWNER_INVALID", "The principal specified can not be assigned as an owner of a file." }, | |
111 { "SSH_FX_GROUP_INVALID", "The principal specified can not be assigned as the primary group of a file." }, | |
112 { | |
113 "SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK", | |
114 "The requested operation could not be completed because the specifed byte range lock has not been granted." | |
115 }, | |
116 | |
117 }; | |
118 | |
119 public static final String[] getDescription(int errorCode) { | |
120 if ((errorCode < 0) || (errorCode >= messages.length)) | |
121 return null; | |
122 | |
123 return messages[errorCode]; | |
124 } | |
125 } |