• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JavaUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: register

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>Transform algorithm</code>
 * @param implementingClass <code>implementingClass</code> the implementing
 * class of {@link TransformSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI
 * is already registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the transform
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
        InvalidTransformException {
    JavaUtils.checkRegisterPermission();
    // are we already registered?
    Class<? extends TransformSpi> transformSpi = transformSpiHash.get(algorithmURI);
    if (transformSpi != null) {
        Object exArgs[] = { algorithmURI, transformSpi };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }
    Class<? extends TransformSpi> transformSpiClass =
        (Class<? extends TransformSpi>)
            ClassLoaderUtils.loadClass(implementingClass, Transform.class);
    transformSpiHash.put(algorithmURI, transformSpiClass);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Transform.java


示例2: register

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:SignatureAlgorithm.java


示例3: register

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass =
        canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(
        algorithmURI, (Class<? extends CanonicalizerSpi>)Class.forName(implementingClass)
    );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:Canonicalizer.java


示例4: getBytes

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
/**
 * Returns the byte array from input which was specified as the parameter of
 * {@link XMLSignatureInput} constructor
 *
 * @return the byte[] from input which was specified as the parameter of
 * {@link XMLSignatureInput} constructor
 *
 * @throws CanonicalizationException
 * @throws IOException
 */
public byte[] getBytes() throws IOException, CanonicalizationException {
    if (bytes!=null) {
        return bytes;
    }
    InputStream is = getResetableInputStream();
    if (is!=null) {
        //resetable can read again bytes.
        if (bytes==null) {
            is.reset();
            bytes=JavaUtils.getBytesFromStream(is);
        }
        return bytes;
    }
    Canonicalizer20010315OmitComments c14nizer =
            new Canonicalizer20010315OmitComments();
    bytes=c14nizer.engineCanonicalize(this);
    return bytes;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:29,代码来源:XMLSignatureInput.java


示例5: getResetableInputStream

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
protected InputStream getResetableInputStream() throws IOException{
    if ((_inputOctetStreamProxy instanceof ByteArrayInputStream) ) {
        if (!_inputOctetStreamProxy.markSupported()) {
            throw new RuntimeException("Accepted as Markable but not truly been"+_inputOctetStreamProxy);
        }
        return _inputOctetStreamProxy;
    }
    if (bytes!=null) {
        _inputOctetStreamProxy=new ByteArrayInputStream(bytes);
        return _inputOctetStreamProxy;
    }
    if (_inputOctetStreamProxy ==null)
        return null;
    if (_inputOctetStreamProxy.markSupported()) {
        log.log(java.util.logging.Level.INFO, "Mark Suported but not used as reset");
    }
    bytes=JavaUtils.getBytesFromStream(_inputOctetStreamProxy);
    _inputOctetStreamProxy.close();
    _inputOctetStreamProxy=new ByteArrayInputStream(bytes);
    return _inputOctetStreamProxy;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:22,代码来源:XMLSignatureInput.java


示例6: register

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
/**
 * Registers a ResourceResolverSpi class. This method logs a warning if
 * the class cannot be registered.
 *
 * @param className the name of the ResourceResolverSpi class to be registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
@SuppressWarnings("unchecked")
public static void register(String className) {
    JavaUtils.checkRegisterPermission();
    try {
        Class<ResourceResolverSpi> resourceResolverClass =
            (Class<ResourceResolverSpi>) Class.forName(className);
        register(resourceResolverClass, false);
    } catch (ClassNotFoundException e) {
        log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ResourceResolver.java


示例7: registerAtStart

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
/**
 * Registers a ResourceResolverSpi class at the beginning of the provider
 * list. This method logs a warning if the class cannot be registered.
 *
 * @param className the name of the ResourceResolverSpi class to be registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
@SuppressWarnings("unchecked")
public static void registerAtStart(String className) {
    JavaUtils.checkRegisterPermission();
    try {
        Class<ResourceResolverSpi> resourceResolverClass =
            (Class<ResourceResolverSpi>) Class.forName(className);
        register(resourceResolverClass, true);
    } catch (ClassNotFoundException e) {
        log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ResourceResolver.java


示例8: getBytesFromInputStream

import com.sun.org.apache.xml.internal.security.utils.JavaUtils; //导入依赖的package包/类
private byte[] getBytesFromInputStream() throws IOException {
    if (bytes != null) {
        return bytes;
    }
    if (inputOctetStreamProxy == null) {
        return null;
    }
    try {
        bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy);
    } finally {
        inputOctetStreamProxy.close();
    }
    return bytes;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:XMLSignatureInput.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MockHttpOutputMessage类代码示例发布时间:2022-05-21
下一篇:
Java ISOMLayout类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap