1 19 20 package org.netbeans.modules.derby.spi.support; 21 22 import java.io.File ; 23 import org.netbeans.modules.derby.DerbyOptions; 24 import org.netbeans.modules.derby.RegisterDerby; 25 import org.openide.util.NbBundle; 26 27 31 public final class DerbySupport { 32 33 private DerbySupport() { 34 } 35 36 43 public static void setLocation(String location) { 44 DerbyOptions.getDefault().setLocation(location); 45 } 46 47 51 public static String getLocation() { 52 return DerbyOptions.getDefault().getLocation(); 53 } 54 55 59 public static void setSystemHome(String systemHome) { 60 DerbyOptions.getDefault().setSystemHome(systemHome); 61 } 62 63 67 public static String getSystemHome() { 68 return DerbyOptions.getDefault().getSystemHome(); 69 } 70 71 75 public static String getDefaultSystemHome() { 76 String propertySystemHome = System.getProperty(DerbyOptions.NETBEANS_DERBY_SYSTEM_HOME); 78 if (propertySystemHome != null) { 79 return propertySystemHome; 80 } 81 82 String userHome = System.getProperty("user.home"); return new File (userHome, NbBundle.getMessage(DerbySupport.class, "LBL_DerbyDatabaseDirectory")).getAbsolutePath(); 84 } 85 86 92 public static void ensureStarted() { 93 RegisterDerby.getDefault().ensureStarted(); 94 } 95 } 96 | Popular Tags |