当前位置: 首页>>代码示例>>Java>>正文


Java SecuritySupport类代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.utils.SecuritySupport的典型用法代码示例。如果您正苦于以下问题:Java SecuritySupport类的具体用法?Java SecuritySupport怎么用?Java SecuritySupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SecuritySupport类属于com.sun.org.apache.xerces.internal.utils包,在下文中一共展示了SecuritySupport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMessage

import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入依赖的package包/类
/**
 * Overrides this method to get the formatted&localized error message.
 *
 * REVISIT: the system locale is used to load the property file.
 *          do we want to allow the appilcation to specify a
 *          different locale?
 */
public String getMessage() {
    ResourceBundle resourceBundle = null;
    resourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages");
    if (resourceBundle == null)
        throw new MissingResourceException("Property file not found!", "com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", key);

    String msg = resourceBundle.getString(key);
    if (msg == null) {
        msg = resourceBundle.getString("BadMessageKey");
        throw new MissingResourceException(msg, "com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", key);
    }

    if (args != null) {
        try {
            msg = java.text.MessageFormat.format(msg, args);
        } catch (Exception e) {
            msg = resourceBundle.getString("FormatFailed");
            msg += " " + resourceBundle.getString(key);
        }
    }

    return msg;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:DatatypeException.java

示例2: loadSchema

import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入依赖的package包/类
/**
 * This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator.
 * Note: in either case, the EntityManager (or EntityResolvers) are not going to be invoked
 * to resolve the location of the schema in XSDDescription
 * @param desc
 * @param source
 * @param locationPairs
 * @return An XML Schema grammar
 * @throws IOException
 * @throws XNIException
 */
SchemaGrammar loadSchema(XSDDescription desc,
        XMLInputSource source,
        Map locationPairs) throws IOException, XNIException {

    // this should only be done once per invocation of this object;
    // unless application alters JAXPSource in the mean time.
    if(!fJAXPProcessed) {
        processJAXPSchemaSource(locationPairs);
    }

    if (desc.isExternal()) {
        String accessError = SecuritySupport.checkAccess(desc.getExpandedSystemId(), faccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL);
        if (accessError != null) {
            throw new XNIException(fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
                    "schema_reference.access",
                    new Object[] { SecuritySupport.sanitizePath(desc.getExpandedSystemId()), accessError }, XMLErrorReporter.SEVERITY_ERROR));
        }
    }
    SchemaGrammar grammar = fSchemaHandler.parseSchema(source, desc, locationPairs);

    return grammar;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:XMLSchemaLoader.java

示例3: 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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:Resolver.java

示例4: 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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Resolver.java

示例5: 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:CatalogManager.java

示例6: 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"));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:CatalogManager.java

示例7: 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"));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:CatalogManager.java

示例8: 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"));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:CatalogManager.java

示例9: 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:CatalogManager.java

示例10: 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));
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:XMLStreamWriterImpl.java

示例11: loadSchema

import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入依赖的package包/类
/**
 * This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator.
 * Note: in either case, the EntityManager (or EntityResolvers) are not going to be invoked
 * to resolve the location of the schema in XSDDescription
 * @param desc
 * @param source
 * @param locationPairs
 * @return An XML Schema grammar
 * @throws IOException
 * @throws XNIException
 */
SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source,
        Map<String, LocationArray> locationPairs) throws IOException, XNIException {

    // this should only be done once per invocation of this object;
    // unless application alters JAXPSource in the mean time.
    if(!fJAXPProcessed) {
        processJAXPSchemaSource(locationPairs);
    }

    if (desc.isExternal() && !source.isCreatedByResolver()) {
        String accessError = SecuritySupport.checkAccess(desc.getExpandedSystemId(), faccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL);
        if (accessError != null) {
            throw new XNIException(fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
                    "schema_reference.access",
                    new Object[] { SecuritySupport.sanitizePath(desc.getExpandedSystemId()), accessError }, XMLErrorReporter.SEVERITY_ERROR));
        }
    }
    SchemaGrammar grammar = fSchemaHandler.parseSchema(source, desc, locationPairs);

    return grammar;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:XMLSchemaLoader.java

示例12: 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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:27,代码来源:XMLGregorianCalendarImpl.java

示例13: loadSchema

import com.sun.org.apache.xerces.internal.utils.SecuritySupport; //导入依赖的package包/类
/**
 * This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator.
 * Note: in either case, the EntityManager (or EntityResolvers) are not going to be invoked
 * to resolve the location of the schema in XSDDescription
 * @param desc
 * @param source
 * @param locationPairs
 * @return An XML Schema grammar
 * @throws IOException
 * @throws XNIException
 */
SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source,
        Map<String, LocationArray> locationPairs) throws IOException, XNIException {

    // this should only be done once per invocation of this object;
    // unless application alters JAXPSource in the mean time.
    if(!fJAXPProcessed) {
        processJAXPSchemaSource(locationPairs);
    }

    if (desc.isExternal()) {
        String accessError = SecuritySupport.checkAccess(desc.getExpandedSystemId(), faccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL);
        if (accessError != null) {
            throw new XNIException(fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
                    "schema_reference.access",
                    new Object[] { SecuritySupport.sanitizePath(desc.getExpandedSystemId()), accessError }, XMLErrorReporter.SEVERITY_ERROR));
        }
    }
    SchemaGrammar grammar = fSchemaHandler.parseSchema(source, desc, locationPairs);

    return grammar;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:33,代码来源:XMLSchemaLoader.java

示例14: 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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:29,代码来源:CatalogManager.java

示例15: 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"));
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:29,代码来源:CatalogManager.java


注:本文中的com.sun.org.apache.xerces.internal.utils.SecuritySupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。