View Javadoc

1   /**
2    * Copyright 2010-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util.secure;
17  
18  import java.io.File;
19  import java.io.IOException;
20  import java.io.InputStream;
21  import java.io.OutputStream;
22  
23  public interface SecureChannel {
24  
25  	void open() throws IOException;
26  
27  	void close();
28  
29  	void copyFile(File source, RemoteFile destination);
30  
31  	void copyLocationToFile(String location, RemoteFile destination);
32  
33  	void copyInputStreamToFile(InputStream source, RemoteFile destination);
34  
35  	void copyStringToFile(String string, RemoteFile destination);
36  
37  	void copyLocationToDirectory(String location, RemoteFile destination);
38  
39  	void copyFileToDirectory(File source, RemoteFile destination);
40  
41  	void copyFile(RemoteFile source, File destination);
42  
43  	void copyFileToDirectory(RemoteFile source, File destination);
44  
45  	RemoteFile getMetaData(String absolutePath);
46  
47  	boolean exists(String absolutePath);
48  
49  	boolean isDirectory(String absolutePath);
50  
51  	void deleteFile(String absolutePath);
52  
53  	void createDirectory(RemoteFile dir);
54  
55  	RemoteFile getWorkingDirectory();
56  
57  	Result executeCommand(String command);
58  
59  	Result executeCommand(String command, String stdin);
60  
61  	void executeNoWait(String command);
62  
63  	void copyRemoteFile(String absolutePath, OutputStream out) throws IOException;
64  
65  	void copyFile(RemoteFile source, OutputStream out) throws IOException;
66  
67  	String toString(RemoteFile source);
68  
69  }