001: package ch.ethz.ssh2.sftp;
002:
003: /**
004: *
005: * SFTP Error Codes
006: *
007: * @author Christian Plattner, plattner@inf.ethz.ch
008: * @version $Id: ErrorCodes.java,v 1.3 2006/10/06 13:28:43 cplattne Exp $
009: *
010: */
011: public class ErrorCodes {
012: public static final int SSH_FX_OK = 0;
013: public static final int SSH_FX_EOF = 1;
014: public static final int SSH_FX_NO_SUCH_FILE = 2;
015: public static final int SSH_FX_PERMISSION_DENIED = 3;
016: public static final int SSH_FX_FAILURE = 4;
017: public static final int SSH_FX_BAD_MESSAGE = 5;
018: public static final int SSH_FX_NO_CONNECTION = 6;
019: public static final int SSH_FX_CONNECTION_LOST = 7;
020: public static final int SSH_FX_OP_UNSUPPORTED = 8;
021: public static final int SSH_FX_INVALID_HANDLE = 9;
022: public static final int SSH_FX_NO_SUCH_PATH = 10;
023: public static final int SSH_FX_FILE_ALREADY_EXISTS = 11;
024: public static final int SSH_FX_WRITE_PROTECT = 12;
025: public static final int SSH_FX_NO_MEDIA = 13;
026: public static final int SSH_FX_NO_SPACE_ON_FILESYSTEM = 14;
027: public static final int SSH_FX_QUOTA_EXCEEDED = 15;
028: public static final int SSH_FX_UNKNOWN_PRINCIPAL = 16;
029: public static final int SSH_FX_LOCK_CONFLICT = 17;
030: public static final int SSH_FX_DIR_NOT_EMPTY = 18;
031: public static final int SSH_FX_NOT_A_DIRECTORY = 19;
032: public static final int SSH_FX_INVALID_FILENAME = 20;
033: public static final int SSH_FX_LINK_LOOP = 21;
034: public static final int SSH_FX_CANNOT_DELETE = 22;
035: public static final int SSH_FX_INVALID_PARAMETER = 23;
036: public static final int SSH_FX_FILE_IS_A_DIRECTORY = 24;
037: public static final int SSH_FX_BYTE_RANGE_LOCK_CONFLICT = 25;
038: public static final int SSH_FX_BYTE_RANGE_LOCK_REFUSED = 26;
039: public static final int SSH_FX_DELETE_PENDING = 27;
040: public static final int SSH_FX_FILE_CORRUPT = 28;
041: public static final int SSH_FX_OWNER_INVALID = 29;
042: public static final int SSH_FX_GROUP_INVALID = 30;
043: public static final int SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK = 31;
044:
045: private static final String[][] messages = {
046:
047: { "SSH_FX_OK",
048: "Indicates successful completion of the operation." },
049: {
050: "SSH_FX_EOF",
051: "An attempt to read past the end-of-file was made; or, there are no more directory entries to return." },
052: { "SSH_FX_NO_SUCH_FILE",
053: "A reference was made to a file which does not exist." },
054: { "SSH_FX_PERMISSION_DENIED",
055: "The user does not have sufficient permissions to perform the operation." },
056: { "SSH_FX_FAILURE",
057: "An error occurred, but no specific error code exists to describe the failure." },
058: { "SSH_FX_BAD_MESSAGE",
059: "A badly formatted packet or other SFTP protocol incompatibility was detected." },
060: { "SSH_FX_NO_CONNECTION",
061: "There is no connection to the server." },
062: { "SSH_FX_CONNECTION_LOST",
063: "The connection to the server was lost." },
064: {
065: "SSH_FX_OP_UNSUPPORTED",
066: "An attempted operation could not be completed by the server because the server does not support the operation." },
067: { "SSH_FX_INVALID_HANDLE", "The handle value was invalid." },
068: { "SSH_FX_NO_SUCH_PATH",
069: "The file path does not exist or is invalid." },
070: { "SSH_FX_FILE_ALREADY_EXISTS", "The file already exists." },
071: { "SSH_FX_WRITE_PROTECT",
072: "The file is on read-only media, or the media is write protected." },
073: {
074: "SSH_FX_NO_MEDIA",
075: "The requested operation cannot be completed because there is no media available in the drive." },
076: {
077: "SSH_FX_NO_SPACE_ON_FILESYSTEM",
078: "The requested operation cannot be completed because there is insufficient free space on the filesystem." },
079: {
080: "SSH_FX_QUOTA_EXCEEDED",
081: "The operation cannot be completed because it would exceed the user's storage quota." },
082: {
083: "SSH_FX_UNKNOWN_PRINCIPAL",
084: "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." },
085: { "SSH_FX_LOCK_CONFLICT",
086: "The file could not be opened because it is locked by another process." },
087: { "SSH_FX_DIR_NOT_EMPTY", "The directory is not empty." },
088: { "SSH_FX_NOT_A_DIRECTORY",
089: "The specified file is not a directory." },
090: { "SSH_FX_INVALID_FILENAME", "The filename is not valid." },
091: {
092: "SSH_FX_LINK_LOOP",
093: "Too many symbolic links encountered or, an SSH_FXF_NOFOLLOW open encountered a symbolic link as the final component." },
094: {
095: "SSH_FX_CANNOT_DELETE",
096: "The file cannot be deleted. One possible reason is that the advisory READONLY attribute-bit is set." },
097: {
098: "SSH_FX_INVALID_PARAMETER",
099: "One of the parameters was out of range, or the parameters specified cannot be used together." },
100: {
101: "SSH_FX_FILE_IS_A_DIRECTORY",
102: "The specified file was a directory in a context where a directory cannot be used." },
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: { "SSH_FX_BYTE_RANGE_LOCK_REFUSED",
107: "A request for a byte range lock was refused." },
108: { "SSH_FX_DELETE_PENDING",
109: "An operation was attempted on a file for which a delete operation is pending." },
110: { "SSH_FX_FILE_CORRUPT",
111: "The file is corrupt; an filesystem integrity check should be run." },
112: { "SSH_FX_OWNER_INVALID",
113: "The principal specified can not be assigned as an owner of a file." },
114: { "SSH_FX_GROUP_INVALID",
115: "The principal specified can not be assigned as the primary group of a file." },
116: {
117: "SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK",
118: "The requested operation could not be completed because the specifed byte range lock has not been granted." },
119:
120: };
121:
122: public static final String[] getDescription(int errorCode) {
123: if ((errorCode < 0) || (errorCode >= messages.length))
124: return null;
125:
126: return messages[errorCode];
127: }
128: }
|