1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.channel.api;
17
18 import java.io.File;
19 import java.io.IOException;
20 import java.io.InputStream;
21 import java.io.OutputStream;
22 import java.util.List;
23
24 import org.kuali.common.util.channel.model.CommandContext;
25 import org.kuali.common.util.channel.model.CommandResult;
26 import org.kuali.common.util.channel.model.CopyResult;
27 import org.kuali.common.util.channel.model.RemoteFile;
28
29 public interface SecureChannel {
30
31 CommandResult exec(CommandContext context);
32
33 List<CommandResult> exec(CommandContext... contexts);
34
35
36
37
38 CommandResult exec(String command);
39
40
41
42
43 List<CommandResult> exec(String... commands);
44
45
46
47
48 void execNoWait(String command);
49
50 void execNoWait(byte[] command);
51
52 CopyResult scp(File source, RemoteFile destination);
53
54 CopyResult scp(String location, RemoteFile destination);
55
56 CopyResult scp(InputStream source, RemoteFile destination);
57
58
59
60
61 CopyResult scpString(String string, RemoteFile destination);
62
63 CopyResult scpToDir(String location, RemoteFile directory);
64
65 CopyResult scpToDir(File source, RemoteFile directory);
66
67 CopyResult scp(RemoteFile source, File destination);
68
69 CopyResult scpToDir(RemoteFile source, File directory);
70
71 RemoteFile getMetaData(String absolutePath);
72
73 boolean exists(String absolutePath);
74
75 boolean isDirectory(String absolutePath);
76
77 void deleteFile(String absolutePath);
78
79 void createDirectory(RemoteFile dir);
80
81 RemoteFile getWorkingDirectory();
82
83 CopyResult scp(String absolutePath, OutputStream out) throws IOException;
84
85 CopyResult scp(RemoteFile source, OutputStream out) throws IOException;
86
87 String toString(RemoteFile source);
88
89 void close();
90
91 }