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

Java URLHandlerRegistry类代码示例

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

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



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

示例1: parse

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
public static void parse(
        URL xmlURL, URL schema, DefaultHandler handler)
        throws SAXException, IOException, ParserConfigurationException {
    InputStream xmlStream = URLHandlerRegistry.getDefault().openStream(xmlURL);
    try {
        InputSource inSrc = new InputSource(xmlStream);
        inSrc.setSystemId(xmlURL.toExternalForm());
        parse(inSrc, schema, handler);
    } finally {
        try {
            xmlStream.close();
        } catch (IOException e) {
            // ignored
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:IvyXmlModuleDescriptorParser.java


示例2: configureURLHandler

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
private void configureURLHandler() {
    // TODO : the credentialStore should also be scoped
    CredentialsStore.INSTANCE.addCredentials(getRealm(), getHost(), getUsername(), getPasswd());

    URLHandlerDispatcher dispatcher = new URLHandlerDispatcher();
    URLHandler httpHandler = URLHandlerRegistry.getHttp();
    dispatcher.setDownloader("http", httpHandler);
    dispatcher.setDownloader("https", httpHandler);
    URLHandlerRegistry.setDefault(dispatcher);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:IvyAntSettings.java


示例3: configureURLHandler

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
private static void configureURLHandler(String realm, String host, String username,
        String passwd) {
    CredentialsStore.INSTANCE.addCredentials(realm, host, username, passwd);

    URLHandlerDispatcher dispatcher = new URLHandlerDispatcher();
    URLHandler httpHandler = URLHandlerRegistry.getHttp();
    dispatcher.setDownloader("http", httpHandler);
    dispatcher.setDownloader("https", httpHandler);
    URLHandlerRegistry.setDefault(dispatcher);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:Main.java


示例4: parse

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
public static void parse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler)
        throws SAXException, IOException, ParserConfigurationException {
    InputStream xmlStream = URLHandlerRegistry.getDefault().openStream(xmlURL, null);
    try {
        InputSource inSrc = new InputSource(xmlStream);
        inSrc.setSystemId(toSystemId(xmlURL));
        parse(inSrc, schema, handler, lHandler);
    } finally {
        try {
            xmlStream.close();
        } catch (IOException e) {
            // ignored
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:16,代码来源:XMLHelper.java


示例5: init

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
private void init() {
    final URLInfo info = URLHandlerRegistry.getDefault().getURLInfo(url, this.timeoutConstraint);
    contentLength = info.getContentLength();
    lastModified = info.getLastModified();
    exists = info.isReachable();
    init = true;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:8,代码来源:URLResource.java


示例6: configureURLHandler

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
private void configureURLHandler() {
    URLHandlerDispatcher dispatcher = new URLHandlerDispatcher();
    URLHandler httpHandler = URLHandlerRegistry.getHttp();
    dispatcher.setDownloader("http", httpHandler);
    dispatcher.setDownloader("https", httpHandler);
    URLHandlerRegistry.setDefault(dispatcher);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:8,代码来源:OnlineXmlSettingsParserTest.java


示例7: copy

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
public static void copy(final URL src, final File dest, final CopyProgressListener listener,
                        final TimeoutConstraint timeoutConstraint) throws IOException {
    URLHandlerRegistry.getDefault().download(src, dest, listener, timeoutConstraint);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:5,代码来源:FileUtil.java


示例8: settingsStarted

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
private void settingsStarted(String qName, Map<String, String> attributes) {
    if ("conf".equals(qName) && !deprecatedMessagePrinted) {
        Message.deprecated("'conf' is deprecated, use 'settings' instead (" + settings + ")");
    }
    String cache = attributes.get("defaultCache");
    if (cache != null) {
        Message.deprecated("'defaultCache' is deprecated, "
                + "use 'caches[@defaultCacheDir]' instead (" + settings + ")");
        ivy.setDefaultCache(Checks.checkAbsolute(cache, "defaultCache"));
    }
    String defaultBranch = attributes.get("defaultBranch");
    if (defaultBranch != null) {
        ivy.setDefaultBranch(defaultBranch);
    }
    String defaultResolveMode = attributes.get("defaultResolveMode");
    if (defaultResolveMode != null) {
        ivy.setDefaultResolveMode(defaultResolveMode);
    }
    String validate = attributes.get("validate");
    if (validate != null) {
        ivy.setValidate(Boolean.valueOf(validate));
    }
    String up2d = attributes.get("checkUpToDate");
    if (up2d != null) {
        Message.deprecated("'checkUpToDate' is deprecated, "
                + "use the 'overwriteMode' on the 'ivy:retrieve' task instead (" + settings
                + ")");
        ivy.setCheckUpToDate(Boolean.valueOf(up2d));
    }
    String useRemoteConfig = attributes.get("useRemoteConfig");
    if (useRemoteConfig != null) {
        ivy.setUseRemoteConfig(Boolean.valueOf(useRemoteConfig));
    }
    String cacheIvyPattern = attributes.get("cacheIvyPattern");
    if (cacheIvyPattern != null) {
        Message.deprecated("'cacheIvyPattern' is deprecated, use 'caches[@ivyPattern]' instead"
                + " (" + settings + ")");
        ivy.setDefaultCacheIvyPattern(cacheIvyPattern);
    }
    String cacheArtPattern = attributes.get("cacheArtifactPattern");
    if (cacheArtPattern != null) {
        Message.deprecated("'cacheArtifactPattern' is deprecated, "
                + "use 'caches[@artifactPattern]' instead (" + settings + ")");
        ivy.setDefaultCacheArtifactPattern(cacheArtPattern);
    }

    // we do not set following defaults here since no instances has been registered yet
    defaultResolver = attributes.get("defaultResolver");
    defaultCM = attributes.get("defaultConflictManager");
    defaultLatest = attributes.get("defaultLatestStrategy");
    defaultCircular = attributes.get("circularDependencyStrategy");

    String requestMethod = attributes.get("httpRequestMethod");
    if ("head".equalsIgnoreCase(requestMethod)) {
        URLHandlerRegistry.getHttp().setRequestMethod(URLHandler.REQUEST_METHOD_HEAD);
    } else if ("get".equalsIgnoreCase(requestMethod)) {
        URLHandlerRegistry.getHttp().setRequestMethod(URLHandler.REQUEST_METHOD_GET);
    } else if (!isNullOrEmpty(requestMethod)) {
        throw new IllegalArgumentException(
                "Invalid httpRequestMethod specified, must be one of {'HEAD', 'GET'}");
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:63,代码来源:XmlSettingsParser.java


示例9: PomReader

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
public PomReader(final URL descriptorURL, final Resource res) throws IOException, SAXException {
    InputStream stream = new AddDTDFilterInputStream(
            URLHandlerRegistry.getDefault().openStream(descriptorURL, null));
    InputSource source = new InputSource(stream);
    source.setSystemId(XMLHelper.toSystemId(descriptorURL));
    try {
        Document pomDomDoc = XMLHelper.parseToDom(source, new EntityResolver() {
            public InputSource resolveEntity(String publicId, String systemId)
                    throws SAXException, IOException {
                if (systemId != null && systemId.endsWith("m2-entities.ent")) {
                    return new InputSource(
                            PomReader.class.getResourceAsStream("m2-entities.ent"));
                }
                return null;
            }
        });
        projectElement = pomDomDoc.getDocumentElement();
        if (!PROJECT.equals(projectElement.getNodeName())
                && !MODEL.equals(projectElement.getNodeName())) {
            throw new SAXParseException("project must be the root tag", res.getName(),
                    res.getName(), 0, 0);
        }
        parentElement = getFirstChildElement(projectElement, PARENT);
    } finally {
        try {
            stream.close();
        } catch (IOException e) {
            // ignore
        }
    }
    // Both environment and system properties take precedence over properties set in
    // pom.xml. So we pre-populate our properties with the environment and system properties
    // here
    for (final Map.Entry<String, String> envEntry : System.getenv().entrySet()) {
        // Maven let's users use "env." prefix for environment variables
        this.setProperty("env." + envEntry.getKey(), envEntry.getValue());
    }
    // add system properties
    final Properties sysProps = System.getProperties();
    for (final String sysProp : sysProps.stringPropertyNames()) {
        this.setProperty(sysProp, sysProps.getProperty(sysProp));
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:44,代码来源:PomReader.java


示例10: openStream

import org.apache.ivy.util.url.URLHandlerRegistry; //导入依赖的package包/类
public InputStream openStream() throws IOException {
    return URLHandlerRegistry.getDefault().openStream(url, null);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:4,代码来源:URLResource.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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