/** * An extension over <code>System.getProperty</code> method. * Handles security restrictions, and returns <code>null</code> * if the access to the property is restricted. * @param property The system property name. * @return The value of the system property, * or the default value. */ public static String getProperty(String property) { return getProperty(property, null); }
/** * An extension over <code>System.getProperty</code> method. * Handles security restrictions, and returns <code>null</code> * if the access to the property is restricted. * @param property The system property name. * @return The value of the system property, * or the default value. */ public static String getProperty(String property) { return getProperty(property, null); }
/** * An extension over <code>System.getProperty</code> method. * Handles security restrictions, and returns <code>null</code> * if the access to the property is restricted. * @param property The system property name. * @return The value of the system property, * or the default value. */ public static String getProperty(String property) { return getProperty(property, null); }
/** * An extension over <code>System.getProperty</code> method. * Handles security restrictions, and returns <code>null</code> * if the access to the property is restricted. * @param property The system property name. * @return The value of the system property, * or the default value. */ public static String getProperty(String property) { return getProperty(property, null); }
public static String getRubygemsDir(Ruby runtime) { // used when integrating JRuby with system RubyGems - example: /usr/share/rubygems return SafePropertyAccessor.getProperty("vendor.dir.rubygems", null); }
public static String getRubygemsDir(Ruby runtime) { // used when integrating JRuby with system RubyGems - example: /usr/share/rubygems return SafePropertyAccessor.getProperty("vendor.dir.rubygems", null); }
public static String getOSName() { if (Platform.IS_LINUX) return RUBY_LINUX; if (Platform.IS_MAC) return RUBY_DARWIN; if (Platform.IS_WINDOWS) return RUBY_WIN32; String osName = SafePropertyAccessor.getProperty("os.name"); String rubyName = RUBY_OS_NAMES.get(osName); return rubyName == null ? osName : rubyName; }
public static String getOSName() { if (Platform.IS_LINUX) return RUBY_LINUX; if (Platform.IS_MAC) return RUBY_DARWIN; if (Platform.IS_WINDOWS) return RUBY_WIN32; String osName = SafePropertyAccessor.getProperty("os.name"); String rubyName = RUBY_OS_NAMES.get(osName); return rubyName == null ? osName : rubyName; }
/** * Java 9 has much more restrictive reflection access to e.g. java.lang classes, and raises a Java 9-specific * error. For now we default ji.setAccessible to false so we don't attempt it. */ private static boolean calculateSetAccessibleDefault() { String version = SafePropertyAccessor.getProperty("java.specification.version", "1.7"); return new BigDecimal(version).compareTo(new BigDecimal("1.9")) < 0; }
/** * Java 9 has much more restrictive reflection access to e.g. java.lang classes, and raises a Java 9-specific * error. For now we default ji.setAccessible to false so we don't attempt it. */ private static boolean calculateSetAccessibleDefault() { String version = SafePropertyAccessor.getProperty("java.specification.version", "1.7"); return new BigDecimal(version).compareTo(new BigDecimal("1.9")) < 0; }
private static boolean calculateInvokedynamicDefault() { String javaVersion = SafePropertyAccessor.getProperty("java.specification.version", ""); if (!javaVersion.equals("") && new BigDecimal(javaVersion).compareTo(new BigDecimal("1.8")) >= 0) { return true; } else { // on only if forced return false; } } }
private static boolean calculateInvokedynamicDefault() { String javaVersion = SafePropertyAccessor.getProperty("java.specification.version", ""); if (!javaVersion.equals("") && new BigDecimal(javaVersion).compareTo(new BigDecimal("1.8")) >= 0) { return true; } else { // on only if forced return false; } } }
/** * Gets a local variable behavior from System property. If no value is assigned to * PropertyName.LOCALVARIABLE_BEHAVIOR, given default value is applied. * * @param defaultLaziness a default local variable behavior * @return a local variable behavior */ public static boolean isLazy(boolean defaultLaziness) { boolean lazy = defaultLaziness; String s = SafePropertyAccessor.getProperty(PropertyName.LAZINESS.toString()); if (s == null) return lazy; return Boolean.parseBoolean(s); }
/** * Gets a local variable behavior from System property. If no value is assigned to * PropertyName.LOCALVARIABLE_BEHAVIOR, given default value is applied. * * @param defaultLaziness a default local variable behavior * @return a local variable behavior */ public static boolean isLazy(boolean defaultLaziness) { boolean lazy = defaultLaziness; String s = SafePropertyAccessor.getProperty(PropertyName.LAZINESS.toString()); if (s == null) return lazy; return Boolean.parseBoolean(s); }
public static String getSiteDirGeneral(Ruby runtime) { // siteDirGeneral example: /usr/local/share/jruby/lib/ return newFile(SafePropertyAccessor.getProperty("site.dir.general", getLibDir(runtime))).getPath(); }
public static String getVendorDirGeneral(Ruby runtime) { // vendorDirGeneral example: /usr/share/jruby/lib/ - commonly the same as libdir return newFile(SafePropertyAccessor.getProperty("vendor.dir.general", getLibDir(runtime))).getPath(); }
public static String getVendorDirGeneral(Ruby runtime) { // vendorDirGeneral example: /usr/share/jruby/lib/ - commonly the same as libdir return newFile(SafePropertyAccessor.getProperty("vendor.dir.general", getLibDir(runtime))).getPath(); }
public static String getVendorDirGeneral(Ruby runtime) { // vendorDirGeneral example: /usr/share/jruby/lib/ - commonly the same as libdir return new NormalizedFile(SafePropertyAccessor.getProperty("vendor.dir.general", getLibDir(runtime))).getPath(); }
public static String getVendorDirGeneral(Ruby runtime) { // vendorDirGeneral example: /usr/share/jruby/lib/ - commonly the same as libdir return new NormalizedFile(SafePropertyAccessor.getProperty("vendor.dir.general", getLibDir(runtime))).getPath(); }
public static String getSiteDirGeneral(Ruby runtime) { // siteDirGeneral example: /usr/local/share/jruby/lib/ return new NormalizedFile(SafePropertyAccessor.getProperty("site.dir.general", getLibDir(runtime))).getPath(); }