1 public static void main(java.lang.String[] args) {
2 FileExchangeConnection conn;
3 System.out.println("prop reset : "+ System.getProperty("user.dir"));
4 try{
5 XmlMgr xmlmgr = new XmlMgr();
6 InputStream in = FtpProperty.class.getResource(
7 FtpProperty.get("ftpInFile")).openStream();
8 xmlmgr.buildTrees(in);
9 List exSessionList = xmlmgr.getFtpwork().getExchangeSession();
10 ExchangeSession entry;
11 Connectable mgr;
12 for (ListIterator i = exSessionList.listIterator(); i.hasNext();) {
13 entry = (ExchangeSession)i.next();
14 Class veriable = Class.forName(FtpProperty.get("connectionClass"));
15 mgr = (Connectable) veriable.newInstance();
16 conn = mgr.newConnection(entry);
17 mgr.fileAssociationEntries(conn);
18 conn.disconnect();
} // end forloop
19 xmlmgr.validateTrees();
20 FileOutputStream fMOut = new FileOutputStream(
21 (new File(
22 System.getProperty( "user.dir"),
23 FtpProperty.get("ftpOutFile")
)));
24 xmlmgr.marshalTrees(fMOut);
25 fMOut.close();
}
catch (SecurityException se){
System.out.println("error in Client cls " +se);}
catch (Exception e){
System.out.println("error in Client cls " +e);
}
|