Source code: com/yaftp/ftp/FtpConnection.java
1 /**
2 *
3 * CopyRights Jean-Yves MENGANT 1999,2000,2001,2002
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20 package com.yaftp.ftp ;
21
22 import java.util.* ;
23
24 /**
25
26 in order to emulate FTP commands on any non FTP file system
27 (LocalFile, URL.....) we define following interface which should be
28 implemented by FTP like candidate sessions
29
30 @Author Jean-Yves MENGANT
31 @version : 0.0.1
32
33
34 */
35
36
37 public interface FtpConnection {
38
39 /** proceed with standard change directory command */
40 public void changeDirectory( String name )
41 throws ClientFtpError ;
42
43 /** build a new directory command */
44 public void newDirectory( String name )
45 throws ClientFtpError ;
46
47 /** proceed with rename a file element(Dir or file) */
48 public void rename( String from , String to )
49 throws ClientFtpError ;
50
51
52 /** return true if FTP implementors deasl with local drive session */
53 public boolean isLocal() ;
54
55 /** return a well known name identifying this FTP */
56 public String get_ftpSrvName() ;
57
58 /** retuns the Directory list vector */
59 public Vector filteredList()
60 throws ClientFtpError ;
61
62 /** returns the names of expanded mode list view */
63 public String[] get_column_names() ;
64
65 /** returns OSFtp identification */
66 public String getOSFtp() ;
67
68 /** returns OS detail string if needed */
69 public String getOsDetails() ;
70
71 /**
72 returns true if connection is an MVS FTP session
73 */
74 public boolean isMVS() ;
75
76 /**
77 this idiosynchrasie is used for MVS only
78 */
79 public void set_jesMode( boolean jesMode ) ;
80
81 /**
82 return message appropriate to directory change
83 */
84 public String getDirectoryMessage() ;
85
86 /**
87 Proceed with user entered FTP commands
88 */
89 public String ftpCommand( String command )
90 throws ClientFtpError ;
91
92 /**
93 proceed with single file deletion
94 */
95 public boolean delete( String candidate )
96 throws ClientFtpError ;
97
98 /**
99 proceed with remove empty directory command
100 */
101 public void removeDirectory( String candidate )
102 throws ClientFtpError ;
103
104 /**
105 proceed with needed session termination
106 */
107 public void stop()
108 throws ClientFtpError ;
109 }