1 16 package net.sf.jftp.config; 17 18 import net.sf.jftp.*; 19 import net.sf.jftp.config.*; 20 import net.sf.jftp.gui.*; 21 import net.sf.jftp.gui.base.UIUtils; 22 import net.sf.jftp.system.logging.Log; 23 import net.sf.jftp.util.*; 24 25 import java.io.*; 26 27 28 public class LoadSet 29 { 30 public static String [] loadSet(String file, boolean ask) 33 { 34 try 35 { 36 BufferedReader breader = new BufferedReader(new FileReader(file)); 37 String [] result = new String [6]; 38 result[0] = breader.readLine(); 39 result[1] = breader.readLine(); 40 result[2] = breader.readLine(); 41 result[3] = breader.readLine(); 42 result[4] = breader.readLine(); 43 result[5] = breader.readLine(); 44 45 if((result[2].equals("") || !Settings.getStorePasswords()) && ask) 46 { 47 result[2] = UIUtils.getPasswordFromUser(JFtp.statusP.jftp); 48 Log.debug("fetched: " + result[2] + ", storing: " + 49 Settings.getStorePasswords()); 50 } 51 52 return result; 53 } 54 catch(Exception ex) 55 { 56 } 59 60 return new String [1]; 61 } 62 63 public static String [] loadSet(String file) 64 { 65 return loadSet(file, false); 66 } 67 } 68 | Popular Tags |