comparison app/src/main/java/ch/ethz/ssh2/sftp/Packet.java @ 438:d29cce60f393

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 11:23:55 -0800
parents src/ch/ethz/ssh2/sftp/Packet.java@071eccdff8ea
children
comparison
equal deleted inserted replaced
437:208b31032318 438:d29cce60f393
1 /*
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved.
3 * Please refer to the LICENSE.txt for licensing details.
4 */
5 package ch.ethz.ssh2.sftp;
6
7 /**
8 * SFTP Paket Types
9 *
10 * @author Christian Plattner
11 * @version 2.50, 03/15/10
12 */
13 public class Packet {
14 public static final int SSH_FXP_INIT = 1;
15 public static final int SSH_FXP_VERSION = 2;
16 public static final int SSH_FXP_OPEN = 3;
17 public static final int SSH_FXP_CLOSE = 4;
18 public static final int SSH_FXP_READ = 5;
19 public static final int SSH_FXP_WRITE = 6;
20 public static final int SSH_FXP_LSTAT = 7;
21 public static final int SSH_FXP_FSTAT = 8;
22 public static final int SSH_FXP_SETSTAT = 9;
23 public static final int SSH_FXP_FSETSTAT = 10;
24 public static final int SSH_FXP_OPENDIR = 11;
25 public static final int SSH_FXP_READDIR = 12;
26 public static final int SSH_FXP_REMOVE = 13;
27 public static final int SSH_FXP_MKDIR = 14;
28 public static final int SSH_FXP_RMDIR = 15;
29 public static final int SSH_FXP_REALPATH = 16;
30 public static final int SSH_FXP_STAT = 17;
31 public static final int SSH_FXP_RENAME = 18;
32 public static final int SSH_FXP_READLINK = 19;
33 public static final int SSH_FXP_SYMLINK = 20;
34 public static final int SSH_FXP_LINK = 21;
35
36 public static final int SSH_FXP_STATUS = 101;
37 public static final int SSH_FXP_HANDLE = 102;
38 public static final int SSH_FXP_DATA = 103;
39 public static final int SSH_FXP_NAME = 104;
40 public static final int SSH_FXP_ATTRS = 105;
41
42 /**
43 * SSH_FXP_EXTENDED and SSH_FXP_EXTENDED_REPLY packets can be used to
44 * implement extensions, which can be vendor specific.
45 */
46 public static final int SSH_FXP_EXTENDED = 200;
47 /**
48 * SSH_FXP_EXTENDED and SSH_FXP_EXTENDED_REPLY packets can be used to
49 * implement extensions, which can be vendor specific.
50 */
51 public static final int SSH_FXP_EXTENDED_REPLY = 201;
52
53 public static String forName(int type) {
54 switch (type) {
55 case SSH_FXP_INIT:
56 return "SSH_FXP_INIT";
57
58 case SSH_FXP_VERSION:
59 return "SSH_FXP_VERSION";
60
61 case SSH_FXP_OPEN:
62 return "SSH_FXP_OPEN";
63
64 case SSH_FXP_CLOSE:
65 return "SSH_FXP_CLOSE";
66
67 case SSH_FXP_READ:
68 return "SSH_FXP_READ";
69
70 case SSH_FXP_WRITE:
71 return "SSH_FXP_WRITE";
72
73 case SSH_FXP_LSTAT:
74 return "SSH_FXP_LSTAT";
75
76 case SSH_FXP_FSTAT:
77 return "SSH_FXP_FSTAT";
78
79 case SSH_FXP_SETSTAT:
80 return "SSH_FXP_SETSTAT";
81
82 case SSH_FXP_FSETSTAT:
83 return "SSH_FXP_FSETSTAT";
84
85 case SSH_FXP_OPENDIR:
86 return "SSH_FXP_OPENDIR";
87
88 case SSH_FXP_READDIR:
89 return "SSH_FXP_READDIR";
90
91 case SSH_FXP_REMOVE:
92 return "SSH_FXP_REMOVE";
93
94 case SSH_FXP_MKDIR:
95 return "SSH_FXP_MKDIR";
96
97 case SSH_FXP_RMDIR:
98 return "SSH_FXP_RMDIR";
99
100 case SSH_FXP_REALPATH:
101 return "SSH_FXP_REALPATH";
102
103 case SSH_FXP_STAT:
104 return "SSH_FXP_STAT";
105
106 case SSH_FXP_RENAME:
107 return "SSH_FXP_RENAME";
108
109 case SSH_FXP_READLINK:
110 return "SSH_FXP_READLINK";
111
112 case SSH_FXP_SYMLINK:
113 return "SSH_FXP_SYMLINK";
114
115 case SSH_FXP_STATUS:
116 return "SSH_FXP_STATUS";
117
118 case SSH_FXP_HANDLE:
119 return "SSH_FXP_HANDLE";
120
121 case SSH_FXP_DATA:
122 return "SSH_FXP_DATA";
123
124 case SSH_FXP_NAME:
125 return "SSH_FXP_NAME";
126
127 case SSH_FXP_ATTRS:
128 return "SSH_FXP_ATTRS";
129
130 case SSH_FXP_EXTENDED:
131 return "SSH_FXP_EXTENDED";
132
133 case SSH_FXP_EXTENDED_REPLY:
134 return "SSH_FXP_EXTENDED_REPLY";
135 }
136
137 return null;
138 }
139 }