001: /**
002: *
003: * Java FTP client library.
004: *
005: * Copyright (C) 2000-2003 Enterprise Distributed Technologies Ltd
006: *
007: * www.enterprisedt.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
022: *
023: * Bug fixes, suggestions and comments should be should posted on
024: * http://www.enterprisedt.com/forums/index.php
025: *
026: * Change Log:
027: *
028: * $Log: FTPDataSocket.java,v $
029: * Revision 1.9 2006/10/17 10:27:44 bruceb
030: * added closeChild()
031: *
032: * Revision 1.8 2006/10/11 08:53:13 hans
033: * made cvsId final
034: *
035: * Revision 1.7 2005/06/03 11:26:25 bruceb
036: * comment change
037: *
038: * Revision 1.6 2003/11/15 11:23:55 bruceb
039: * changes required for ssl subclasses
040: *
041: * Revision 1.4 2003/11/02 21:50:14 bruceb
042: * changed FTPDataSocket to an interface
043: *
044: * Revision 1.3 2003/05/31 14:53:44 bruceb
045: * 1.2.2 changes
046: *
047: * Revision 1.2 2002/11/19 22:01:25 bruceb
048: * changes for 1.2
049: *
050: * Revision 1.1 2001/10/09 20:53:46 bruceb
051: * Active mode changes
052: *
053: * Revision 1.1 2001/10/05 14:42:03 bruceb
054: * moved from old project
055: *
056: */package com.enterprisedt.net.ftp;
057:
058: import java.io.IOException;
059: import java.io.InputStream;
060: import java.io.OutputStream;
061:
062: /**
063: * Interface for data socket classes, whether active or passive
064: *
065: * @author Bruce Blackshaw
066: * @version $Revision: 1.9 $
067: */
068: public interface FTPDataSocket {
069:
070: /**
071: * Revision control id
072: */
073: public static final String cvsId = "@(#)$Id: FTPDataSocket.java,v 1.9 2006/10/17 10:27:44 bruceb Exp $";
074:
075: /**
076: * Set the TCP timeout on the underlying control socket.
077: *
078: * If a timeout is set, then any operation which
079: * takes longer than the timeout value will be
080: * killed with a java.io.InterruptedException.
081: *
082: * @param millis The length of the timeout, in milliseconds
083: */
084: public void setTimeout(int millis) throws IOException;
085:
086: /**
087: * Returns the local port to which this socket is bound.
088: *
089: * @return the local port number to which this socket is bound
090: */
091: public int getLocalPort();
092:
093: /**
094: * Get the appropriate output stream for writing to
095: *
096: * @return output stream for underlying socket.
097: */
098: public OutputStream getOutputStream() throws IOException;
099:
100: /**
101: * Get the appropriate input stream for reading from
102: *
103: * @return input stream for underlying socket.
104: */
105: public InputStream getInputStream() throws IOException;
106:
107: /**
108: * Closes underlying socket(s)
109: */
110: public void close() throws IOException;
111:
112: /**
113: * Closes child socket
114: *
115: * @throws IOException
116: */
117: public void closeChild() throws IOException;
118: }
|