01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: * $Id: TestFTP.java 3523 2006-12-08 07:18:35Z jzhang $
24: */
25: package com.bostechcorp.cbesb.runtime.ftp.interpreter;
26:
27: import java.util.HashMap;
28: import java.util.Map;
29:
30: import org.apache.commons.net.ftp.FTPClient;
31:
32: /**
33: * @author j.zhang
34: * @version 1.0.0
35: */
36: public class TestFTP {
37: // private static AbstractCommandExpression cmd;
38: private static FTPClient ftp = new FTPClient();
39: private static CommandInterpreter interpreter = new CommandInterpreter();
40:
41: public static void main(String[] args) {
42:
43: Map<String, String> connectParamMap = new HashMap<String, String>();
44: connectParamMap.put("host", "192.168.1.231");
45: connectParamMap.put("port", "21");
46: connectParamMap.put("username", "cbesb");
47: connectParamMap.put("password", "cbesb");
48: interpreter.addCommand("connect", connectParamMap);
49:
50: Map<String, String> disconnectParamMap = new HashMap<String, String>();
51: interpreter.addCommand("disconnect", disconnectParamMap);
52:
53: interpreter.execute(ftp);
54: }
55: }
|