001 /* 002 * ftp4j - A pure Java FTP client library 003 * 004 * Copyright (C) 2008 Carlo Pelliccia (www.sauronsoftware.it) 005 * 006 * This program is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 018 */ 019 package it.sauronsoftware.ftp4j; 020 021 import java.io.IOException; 022 import java.io.InputStream; 023 import java.io.OutputStream; 024 025 /** 026 * Instances of this one represent connections with remote hosts. 027 * 028 * @author Carlo Pelliccia 029 */ 030 public interface FTPConnection { 031 032 /** 033 * This method returns the InputStream for this connection. 034 * 035 * @return The InputStream for this connection. 036 * @throws IOException 037 * If an I/O error occurs when creating the stream. 038 */ 039 public InputStream getInputStream() throws IOException; 040 041 /** 042 * This method returns the OutputStream for this connection. 043 * 044 * @return The OutputStream for this connection. 045 * @throws IOException 046 * If an I/O error occurs when creating the stream. 047 */ 048 public OutputStream getOutputStream() throws IOException; 049 050 /** 051 * This method closes the connection. 052 * 053 * @throws IOException 054 * If an I/O error occurs when closing the connection. 055 */ 056 public void close() throws IOException; 057 058 }