1 16 package net.sf.jftp.config; 17 18 import java.io.*; 19 20 21 public class SaveSet 22 { 23 private PrintStream out = null; 24 25 public SaveSet(String file, String host, String user, String pass, 26 String name, String port) 27 { 28 try 29 { 30 FileOutputStream fos; 31 out = new PrintStream((fos = new FileOutputStream(file))); 32 out.println(host); 33 out.println(user); 34 35 if(Settings.getStorePasswords()) 36 { 37 out.println(pass); 38 } 39 else 40 { 41 out.println(""); 42 } 43 44 out.println(name); 45 out.println(port); 46 fos.close(); 47 } 48 catch(Exception ex) 49 { 50 ex.printStackTrace(); 51 } 52 } 53 54 public SaveSet(String file, String host, String user, String pass, 55 String port, String cwd, String lcwd) 56 { 57 try 58 { 59 out = new PrintStream(new FileOutputStream(file)); 60 out.println(host); 61 out.println(user); 62 63 if(Settings.getStorePasswords()) 64 { 65 out.println(pass); 66 } 67 else 68 { 69 out.println(""); 70 } 71 72 out.println(port); 73 out.println(cwd); 74 out.println(lcwd); 75 } 76 catch(Exception ex) 77 { 78 ex.printStackTrace(); 79 } 80 } 81 82 public SaveSet(String file, String lsCmd) 89 { 90 try 91 { 92 out = new PrintStream(new FileOutputStream(file)); 93 out.println(lsCmd); 94 } 95 catch(Exception ex) 96 { 97 ex.printStackTrace(); 98 } 99 } 100 } 101 | Popular Tags |