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


Java RetrieveOptions类代码示例

本文整理汇总了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;未经允许,请勿转载。