本文整理汇总了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);
}
示例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));
}
示例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);
}
}
示例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();
}
}
示例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;
}
示例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));
}
示例7: createRetrieveOptions
import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
private static RetrieveOptions createRetrieveOptions() {
final RetrieveOptions retrieveOptions = new RetrieveOptions();
retrieveOptions.setMakeSymlinksInMass(true);
return retrieveOptions;
}
示例8: StartRetrieveEvent
import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public StartRetrieveEvent(ModuleRevisionId mrid, String[] confs, RetrieveOptions options) {
super(NAME, mrid, confs, options);
}
示例9: getOptions
import org.apache.ivy.core.retrieve.RetrieveOptions; //导入依赖的package包/类
public RetrieveOptions getOptions() {
return options;
}