本文整理汇总了Java中com.sun.org.apache.xerces.internal.utils.SecuritySupport.getSystemProperty方法的典型用法代码示例。如果您正苦于以下问题:Java SecuritySupport.getSystemProperty方法的具体用法?Java SecuritySupport.getSystemProperty怎么用?Java SecuritySupport.getSystemProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xerces.internal.utils.SecuritySupport
的用法示例。
在下文中一共展示了SecuritySupport.getSystemProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveAllLocalSystem
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Return all applicable SYSTEM system identifiers in this
* catalog.
*
* <p>If one or more SYSTEM entries exists in the catalog file
* for the system ID specified, return the mapped values.</p>
*
* @param systemId The system ID to locate in the catalog
*
* @return A vector of the mapped system identifiers or null
*/
private Vector resolveAllLocalSystem(String systemId) {
Vector map = new Vector();
String osname = SecuritySupport.getSystemProperty("os.name");
boolean windows = (osname.indexOf("Windows") >= 0);
Enumeration en = catalogEntries.elements();
while (en.hasMoreElements()) {
CatalogEntry e = (CatalogEntry) en.nextElement();
if (e.getEntryType() == SYSTEM
&& (e.getEntryArg(0).equals(systemId)
|| (windows
&& e.getEntryArg(0).equalsIgnoreCase(systemId)))) {
map.addElement(e.getEntryArg(1));
}
}
if (map.size() == 0) {
return null;
} else {
return map;
}
}
示例2: resolveLocalSystemReverse
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Find the URNs for a given system identifier in the current catalog.
*
* @param systemId The system ID to locate.
*
* @return A vector of URNs that map to the systemId.
*/
private Vector resolveLocalSystemReverse(String systemId) {
Vector map = new Vector();
String osname = SecuritySupport.getSystemProperty("os.name");
boolean windows = (osname.indexOf("Windows") >= 0);
Enumeration en = catalogEntries.elements();
while (en.hasMoreElements()) {
CatalogEntry e = (CatalogEntry) en.nextElement();
if (e.getEntryType() == SYSTEM
&& (e.getEntryArg(1).equals(systemId)
|| (windows
&& e.getEntryArg(1).equalsIgnoreCase(systemId)))) {
map.addElement(e.getEntryArg(0));
}
}
if (map.size() == 0) {
return null;
} else {
return map;
}
}
示例3: queryCatalogFiles
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the list of catalog files from the properties.
*
* @return A semicolon delimited list of catlog file URIs
*/
private String queryCatalogFiles () {
String catalogList = SecuritySupport.getSystemProperty(pFiles);
fromPropertiesFile = false;
if (catalogList == null) {
if (resources == null) readProperties();
if (resources != null) {
try {
catalogList = resources.getString("catalogs");
fromPropertiesFile = true;
} catch (MissingResourceException e) {
System.err.println(propertyFile + ": catalogs not found.");
catalogList = null;
}
}
}
if (catalogList == null) {
catalogList = defaultCatalogFiles;
}
return catalogList;
}
示例4: queryPreferPublic
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the preferPublic setting from the properties.
*
* <p>In the properties, a value of 'public' is true,
* anything else is false.</p>
*
* @return True if prefer is public or the
* defaultPreferSetting.
*/
private boolean queryPreferPublic () {
String prefer = SecuritySupport.getSystemProperty(pPrefer);
if (prefer == null) {
if (resources==null) readProperties();
if (resources==null) return defaultPreferPublic;
try {
prefer = resources.getString("prefer");
} catch (MissingResourceException e) {
return defaultPreferPublic;
}
}
if (prefer == null) {
return defaultPreferPublic;
}
return (prefer.equalsIgnoreCase("public"));
}
示例5: queryUseStaticCatalog
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the static-catalog setting from the properties.
*
* <p>In the properties, a value of 'yes', 'true', or '1' is considered
* true, anything else is false.</p>
*
* @return The static-catalog setting from the propertyFile or the
* defaultUseStaticCatalog.
*/
private boolean queryUseStaticCatalog () {
String staticCatalog = SecuritySupport.getSystemProperty(pStatic);
if (staticCatalog == null) {
if (resources==null) readProperties();
if (resources==null) return defaultUseStaticCatalog;
try {
staticCatalog = resources.getString("static-catalog");
} catch (MissingResourceException e) {
return defaultUseStaticCatalog;
}
}
if (staticCatalog == null) {
return defaultUseStaticCatalog;
}
return (staticCatalog.equalsIgnoreCase("true")
|| staticCatalog.equalsIgnoreCase("yes")
|| staticCatalog.equalsIgnoreCase("1"));
}
示例6: queryAllowOasisXMLCatalogPI
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* <p>Obtain the oasisXMLCatalogPI setting from the properties.</p>
*
* <p>In the properties, a value of 'yes', 'true', or '1' is considered
* true, anything else is false.</p>
*
* @return The oasisXMLCatalogPI setting from the propertyFile or the
* defaultOasisXMLCatalogPI.
*/
public boolean queryAllowOasisXMLCatalogPI () {
String allow = SecuritySupport.getSystemProperty(pAllowPI);
if (allow == null) {
if (resources==null) readProperties();
if (resources==null) return defaultOasisXMLCatalogPI;
try {
allow = resources.getString("allow-oasis-xml-catalog-pi");
} catch (MissingResourceException e) {
return defaultOasisXMLCatalogPI;
}
}
if (allow == null) {
return defaultOasisXMLCatalogPI;
}
return (allow.equalsIgnoreCase("true")
|| allow.equalsIgnoreCase("yes")
|| allow.equalsIgnoreCase("1"));
}
示例7: queryCatalogClassName
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the Catalog class name setting from the properties.
*
*/
public String queryCatalogClassName () {
String className = SecuritySupport.getSystemProperty(pClassname);
if (className == null) {
if (resources==null) readProperties();
if (resources==null) return null;
try {
return resources.getString("catalog-class-name");
} catch (MissingResourceException e) {
return null;
}
}
return className;
}
示例8: setOutputUsingStream
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Utility method to create a writer when passed an OutputStream. Make
* sure to wrap an <code>OutputStreamWriter</code> using an
* <code>XMLWriter</code> for performance reasons.
*
* @param os Underlying OutputStream
* @param encoding Encoding used to convert chars into bytes
*/
private void setOutputUsingStream(OutputStream os, String encoding)
throws IOException {
fOutputStream = os;
if (encoding != null) {
if (encoding.equalsIgnoreCase("utf-8")) {
fWriter = new UTF8OutputStreamWriter(os);
}
else {
fWriter = new XMLWriter(new OutputStreamWriter(os, encoding));
fEncoder = Charset.forName(encoding).newEncoder();
}
} else {
encoding = SecuritySupport.getSystemProperty("file.encoding");
if (encoding != null && encoding.equalsIgnoreCase("utf-8")) {
fWriter = new UTF8OutputStreamWriter(os);
} else {
fWriter = new XMLWriter(new OutputStreamWriter(os));
}
}
}
示例9: getDefaultLocale
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
*
* @return default locale
*/
private Locale getDefaultLocale() {
String lang = SecuritySupport.getSystemProperty("user.language.format");
String country = SecuritySupport.getSystemProperty("user.country.format");
String variant = SecuritySupport.getSystemProperty("user.variant.format");
Locale locale = null;
if (lang != null) {
if (country != null) {
if (variant != null) {
locale = new Locale(lang, country, variant);
} else {
locale = new Locale(lang, country);
}
} else {
locale = new Locale(lang);
}
}
if (locale == null) {
locale = Locale.getDefault();
}
return locale;
}
示例10: queryCatalogFiles
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the list of catalog files from the properties.
*
* @return A semicolon delimited list of catlog file URIs
*/
private String queryCatalogFiles () {
String catalogList = SecuritySupport.getSystemProperty(pFiles);
fromPropertiesFile = false;
if (catalogList == null) {
if (resources == null) readProperties();
if (resources != null) {
try {
catalogList = resources.getString("catalogs");
fromPropertiesFile = true;
} catch (MissingResourceException e) {
System.err.println(propertyFile + ": catalogs not found.");
catalogList = null;
}
}
}
if (catalogList == null) {
catalogList = defaultCatalogFiles;
}
return catalogList;
}
示例11: queryPreferPublic
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the preferPublic setting from the properties.
*
* <p>In the properties, a value of 'public' is true,
* anything else is false.</p>
*
* @return True if prefer is public or the
* defaultPreferSetting.
*/
private boolean queryPreferPublic () {
String prefer = SecuritySupport.getSystemProperty(pPrefer);
if (prefer == null) {
if (resources==null) readProperties();
if (resources==null) return defaultPreferPublic;
try {
prefer = resources.getString("prefer");
} catch (MissingResourceException e) {
return defaultPreferPublic;
}
}
if (prefer == null) {
return defaultPreferPublic;
}
return (prefer.equalsIgnoreCase("public"));
}
示例12: queryUseStaticCatalog
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the static-catalog setting from the properties.
*
* <p>In the properties, a value of 'yes', 'true', or '1' is considered
* true, anything else is false.</p>
*
* @return The static-catalog setting from the propertyFile or the
* defaultUseStaticCatalog.
*/
private boolean queryUseStaticCatalog () {
String staticCatalog = SecuritySupport.getSystemProperty(pStatic);
if (staticCatalog == null) {
if (resources==null) readProperties();
if (resources==null) return defaultUseStaticCatalog;
try {
staticCatalog = resources.getString("static-catalog");
} catch (MissingResourceException e) {
return defaultUseStaticCatalog;
}
}
if (staticCatalog == null) {
return defaultUseStaticCatalog;
}
return (staticCatalog.equalsIgnoreCase("true")
|| staticCatalog.equalsIgnoreCase("yes")
|| staticCatalog.equalsIgnoreCase("1"));
}
示例13: queryAllowOasisXMLCatalogPI
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* <p>Obtain the oasisXMLCatalogPI setting from the properties.</p>
*
* <p>In the properties, a value of 'yes', 'true', or '1' is considered
* true, anything else is false.</p>
*
* @return The oasisXMLCatalogPI setting from the propertyFile or the
* defaultOasisXMLCatalogPI.
*/
public boolean queryAllowOasisXMLCatalogPI () {
String allow = SecuritySupport.getSystemProperty(pAllowPI);
if (allow == null) {
if (resources==null) readProperties();
if (resources==null) return defaultOasisXMLCatalogPI;
try {
allow = resources.getString("allow-oasis-xml-catalog-pi");
} catch (MissingResourceException e) {
return defaultOasisXMLCatalogPI;
}
}
if (allow == null) {
return defaultOasisXMLCatalogPI;
}
return (allow.equalsIgnoreCase("true")
|| allow.equalsIgnoreCase("yes")
|| allow.equalsIgnoreCase("1"));
}
示例14: queryCatalogClassName
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/**
* Obtain the Catalog class name setting from the properties.
*
*/
public String queryCatalogClassName () {
String className = SecuritySupport.getSystemProperty(pClassname);
if (className == null) {
if (resources==null) readProperties();
if (resources==null) return null;
try {
return resources.getString("catalog-class-name");
} catch (MissingResourceException e) {
return null;
}
}
return className;
}
示例15: CoreDocumentImpl
import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入方法依赖的package包/类
/** Constructor. */
public CoreDocumentImpl(boolean grammarAccess) {
super(null);
ownerDocument = this;
allowGrammarAccess = grammarAccess;
String systemProp = SecuritySupport.getSystemProperty(Constants.SUN_DOM_PROPERTY_PREFIX+Constants.SUN_DOM_ANCESTOR_CHECCK);
if (systemProp != null) {
if (systemProp.equalsIgnoreCase("false")) {
ancestorChecking = false;
}
}
}