56 */ 57 58 public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; 59 60 /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ 61 public static final String ORACLE_JAXP_PROPERTY_PREFIX = 62 "http://www.oracle.com/xml/jaxp/properties/"; 63 64 //System Properties corresponding to ACCESS_EXTERNAL_* properties 65 public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet"; 66 public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD"; 67 68 69 //all access keyword 70 public static final String ACCESS_EXTERNAL_ALL = "all"; 71 72 /** 73 * Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true 74 */ 75 public static final String EXTERNAL_ACCESS_DEFAULT_FSP = ""; 76 /** 77 * JDK version by which the default is to restrict external connection 78 */ 79 public static final int RESTRICT_BY_DEFAULT_JDK_VERSION = 8; 80 /** 81 * FEATURE_SECURE_PROCESSING (FSP) is false by default 82 */ 83 public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL; 84 85 } // class Constants | 56 */ 57 58 public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; 59 60 /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ 61 public static final String ORACLE_JAXP_PROPERTY_PREFIX = 62 "http://www.oracle.com/xml/jaxp/properties/"; 63 64 //System Properties corresponding to ACCESS_EXTERNAL_* properties 65 public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet"; 66 public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD"; 67 68 69 //all access keyword 70 public static final String ACCESS_EXTERNAL_ALL = "all"; 71 72 /** 73 * Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true 74 */ 75 public static final String EXTERNAL_ACCESS_DEFAULT_FSP = ""; 76 77 /** 78 * FEATURE_SECURE_PROCESSING (FSP) is false by default 79 */ 80 public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL; 81 82 public static final String XML_SECURITY_PROPERTY_MANAGER = 83 ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager"; 84 85 /** 86 * Check if we're in jdk8 or above 87 */ 88 public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8); 89 90 /* 91 * Check the version of the current JDK against that specified in the 92 * parameter 93 * 94 * There is a proposal to change the java version string to: 95 * MAJOR.MINOR.FU.CPU.PSU-BUILDNUMBER_BUGIDNUMBER_OPTIONAL 96 * This method would work with both the current format and that proposed 97 * 98 * @param compareTo a JDK version to be compared to 99 * @return true if the current version is the same or above that represented 100 * by the parameter 101 */ 102 public static boolean isJavaVersionAtLeast(int compareTo) { 103 String javaVersion = SecuritySupport.getSystemProperty("java.version"); 104 String versions[] = javaVersion.split("\\.", 3); 105 if (Integer.parseInt(versions[0]) >= compareTo || 106 Integer.parseInt(versions[1]) >= compareTo) { 107 return true; 108 } 109 return false; 110 } 111 } // class Constants |