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  
22  public interface SecureChannel {
23  
24  	void open() throws IOException;
25  
26  	void close();
27  
28  	void copyFile(File source, RemoteFile destination);
29  
30  	void copyLocationToFile(String location, RemoteFile destination);
31  
32  	void copyInputStreamToFile(InputStream source, RemoteFile destination);
33  
34  	void copyStringToFile(String string, RemoteFile destination);
35  
36  	void copyLocationToDirectory(String location, RemoteFile destination);
37  
38  	void copyFileToDirectory(File source, RemoteFile destination);
39  
40  	void copyFile(RemoteFile source, File destination);
41  
42  	void copyFileToDirectory(RemoteFile source, File destination);
43  
44  	RemoteFile getMetaData(String absolutePath);
45  
46  	boolean exists(String absolutePath);
47  
48  	boolean isDirectory(String absolutePath);
49  
50  	void deleteFile(String absolutePath);
51  
52  	void createDirectory(RemoteFile dir);
53  
54  	RemoteFile getWorkingDirectory();
55  
56  	Result executeCommand(String command);
57  
58  	Result executeCommand(String command, String stdin);
59  
60  }