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

Java RetrieveOptions类代码示例

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

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



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

示例1: testRetrieveOverwriteMode

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
/**
 * Tests that the {@code overwriteMode} passed for the retrieve command works as expected
 *
 * @throws Exception if something goes wrong
 */
@Test
public void testRetrieveOverwriteMode() throws Exception {
    final String[] args = new String[]{"-settings", "test/repositories/ivysettings.xml", "-retrieve",
            "build/test/main/retrieve/overwrite-test/[artifact].[ext]",
            "-overwriteMode", "different",
            "-ivy", "test/repositories/1/org/mod1/ivys/ivy-5.0.xml"};
    final CommandLine parsedCommand = Main.getParser().parse(args);
    final String parsedOverwriteMode = parsedCommand.getOptionValue("overwriteMode");
    assertEquals("Unexpected overwriteMode parsed", RetrieveOptions.OVERWRITEMODE_DIFFERENT, parsedOverwriteMode);
    // create a dummy file which we expect the retrieve task to overwrite
    final Path retrieveArtifactPath = Paths.get("build/test/main/retrieve/overwrite-test/foo-bar.jar");
    Files.createDirectories(retrieveArtifactPath.getParent());
    Files.write(retrieveArtifactPath, new byte[0]);
    assertEquals("Unexpected content at " + retrieveArtifactPath, 0, Files.readAllBytes(retrieveArtifactPath).length);
    // issue the retrieve (which retrieves the org:foo-bar:2.3.4 artifact)
    run(args);
    // expect the existing jar to be overwritten
    assertTrue("Content at " + retrieveArtifactPath + " was not overwritten by retrieve task", Files.readAllBytes(retrieveArtifactPath).length > 0);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:MainTest.java


示例2: determineArtifactsToCopy

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public Map<ArtifactDownloadReport, Set<String>> determineArtifactsToCopy(ModuleId moduleId,
        String[] confs, File cache, String destFilePattern, String destIvyPattern,
        Filter<Artifact> artifactFilter) throws ParseException, IOException {
    return ivy.getRetrieveEngine().determineArtifactsToCopy(
        new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()), destFilePattern,
        new RetrieveOptions().setConfs(confs).setDestIvyPattern(destIvyPattern)
                .setArtifactFilter(artifactFilter));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:Ivy14.java


示例3: retrieve

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public int retrieve(ModuleId moduleId, String[] confs, File cache, String destFilePattern,
        String destIvyPattern, Filter<Artifact> artifactFilter, boolean sync, boolean useOrigin,
        boolean makeSymlinks) {
    try {
        return ivy.retrieve(new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()),
            new RetrieveOptions().setConfs(confs).setDestArtifactPattern(destFilePattern)
                    .setDestIvyPattern(destIvyPattern)
                    .setArtifactFilter(artifactFilter).setSync(sync).setUseOrigin(useOrigin)
                    .setMakeSymlinks(makeSymlinks)).getNbrArtifactsCopied();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:14,代码来源:Ivy14.java


示例4: retrieve

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
@Deprecated
public int retrieve(ModuleRevisionId mrid, String destFilePattern, RetrieveOptions options)
        throws IOException {
    pushContext();
    try {
        return retrieveEngine.retrieve(mrid, destFilePattern, options);
    } finally {
        popContext();
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:Ivy.java


示例5: RetrieveEvent

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
protected RetrieveEvent(String name, ModuleRevisionId mrid, String[] confs,
        RetrieveOptions options) {
    super(name);
    this.mrid = mrid;
    addMridAttributes(mrid);
    addConfsAttribute(confs);
    addAttribute("symlink", String.valueOf(options.isMakeSymlinks()));
    addAttribute("sync", String.valueOf(options.isSync()));
    this.options = options;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:RetrieveEvent.java


示例6: EndRetrieveEvent

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public EndRetrieveEvent(ModuleRevisionId mrid, String[] confs, long elapsedTime,
        int targetsCopied, int targetsUpToDate, long totalCopiedSize, RetrieveOptions options) {
    super(NAME, mrid, confs, options);

    this.duration = elapsedTime;
    this.nbCopied = targetsCopied;
    this.nbUpToDate = targetsUpToDate;
    this.totalCopiedSize = totalCopiedSize;
    addAttribute("duration", String.valueOf(elapsedTime));
    addAttribute("size", String.valueOf(totalCopiedSize));
    addAttribute("nbCopied", String.valueOf(targetsCopied));
    addAttribute("nbUptodate", String.valueOf(targetsUpToDate));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:14,代码来源:EndRetrieveEvent.java


示例7: createRetrieveOptions

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
private static RetrieveOptions createRetrieveOptions() {
  final RetrieveOptions retrieveOptions = new RetrieveOptions();
  retrieveOptions.setMakeSymlinksInMass(true);
  return retrieveOptions;
}
 
开发者ID:spotify,项目名称:bazel-tools,代码行数:6,代码来源:MavenDependencies.java


示例8: StartRetrieveEvent

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public StartRetrieveEvent(ModuleRevisionId mrid, String[] confs, RetrieveOptions options) {
    super(NAME, mrid, confs, options);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:4,代码来源:StartRetrieveEvent.java


示例9: getOptions

import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public RetrieveOptions getOptions() {
    return options;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:4,代码来源:RetrieveEvent.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java TiffMetadataReader类代码示例发布时间:2022-05-22
下一篇:
Java DirectMediaPlayer类代码示例发布时间: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