1 12 package org.eclipse.jsch.internal.core; 13 14 import org.eclipse.core.runtime.Platform; 15 import org.eclipse.core.runtime.preferences.*; 16 17 public class PreferenceInitializer extends AbstractPreferenceInitializer{ 18 19 public static String SSH_HOME_DEFAULT=null; 20 static{ 21 String ssh_dir_name=".ssh"; 23 if(Platform.getOS().equals(Platform.OS_WIN32)){ 25 ssh_dir_name="ssh"; } 27 SSH_HOME_DEFAULT=System.getProperty("user.home"); if(SSH_HOME_DEFAULT!=null){ 29 SSH_HOME_DEFAULT=SSH_HOME_DEFAULT+java.io.File.separator+ssh_dir_name; 30 } 31 } 32 33 public void initializeDefaultPreferences(){ 34 IEclipsePreferences defaultNode=new DefaultScope().getNode(JSchCorePlugin.ID); 35 defaultNode.put(IConstants.KEY_SSH2HOME, SSH_HOME_DEFAULT); 36 defaultNode.put(IConstants.KEY_PRIVATEKEY, IConstants.PRIVATE_KEYS_DEFAULT); 37 Utils.migrateSSH2Preferences(); 38 } 39 40 } 41 | Popular Tags |