001 /* 002 * ftp4j - A pure Java FTP client library 003 * 004 * Copyright (C) 2008-2009 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 Lesser General Public License version 008 * 2.1, as published by the Free Software Foundation. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License version 2.1 along with this program. 017 * If not, see <http://www.gnu.org/licenses/>. 018 */ 019 package it.sauronsoftware.ftp4j; 020 021 import java.io.IOException; 022 023 /** 024 * This interface describes a connector. Connectors are used by the client to 025 * establish connections with remote servers. 026 * 027 * @author Carlo Pelliccia 028 */ 029 public interface FTPConnector { 030 031 /** 032 * This methods returns an established connection to a remote host, suitable 033 * for a FTP communication channel. 034 * 035 * @param host 036 * The remote host name or address. 037 * @param port 038 * The remote port. 039 * @return The connection with the remote host. 040 * @throws IOException 041 * If the connection cannot be established. 042 */ 043 public FTPConnection connectForCommunicationChannel(String host, int port) 044 throws IOException; 045 046 /** 047 * This methods returns an established connection to a remote host, suitable 048 * for a FTP data transfer channel. 049 * 050 * @param host 051 * The remote host name or address. 052 * @param port 053 * The remote port. 054 * @return The connection with the remote host. 055 * @throws IOException 056 * If the connection cannot be established. 057 */ 058 public FTPConnection connectForDataTransferChannel(String host, int port) 059 throws IOException; 060 061 }