001    /**
002     * Copyright 2010-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.common.util.secure;
017    
018    import java.io.File;
019    import java.io.IOException;
020    import java.io.InputStream;
021    import java.io.OutputStream;
022    
023    public interface SecureChannel {
024    
025            void open() throws IOException;
026    
027            void close();
028    
029            void copyFile(File source, RemoteFile destination);
030    
031            void copyLocationToFile(String location, RemoteFile destination);
032    
033            void copyInputStreamToFile(InputStream source, RemoteFile destination);
034    
035            void copyStringToFile(String string, RemoteFile destination);
036    
037            void copyLocationToDirectory(String location, RemoteFile destination);
038    
039            void copyFileToDirectory(File source, RemoteFile destination);
040    
041            void copyFile(RemoteFile source, File destination);
042    
043            void copyFileToDirectory(RemoteFile source, File destination);
044    
045            RemoteFile getMetaData(String absolutePath);
046    
047            boolean exists(String absolutePath);
048    
049            boolean isDirectory(String absolutePath);
050    
051            void deleteFile(String absolutePath);
052    
053            void createDirectory(RemoteFile dir);
054    
055            RemoteFile getWorkingDirectory();
056    
057            Result executeCommand(String command);
058    
059            Result executeCommand(String command, String stdin);
060    
061            void executeNoWait(String command);
062    
063            void copyRemoteFile(String absolutePath, OutputStream out) throws IOException;
064    
065            void copyFile(RemoteFile source, OutputStream out) throws IOException;
066    
067            String toString(RemoteFile source);
068    
069    }