本文整理汇总了Java中org.apache.ivy.core.module.descriptor.Artifact.getExt方法的典型用法代码示例。如果您正苦于以下问题:Java Artifact.getExt方法的具体用法?Java Artifact.getExt怎么用?Java Artifact.getExt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.descriptor.Artifact
的用法示例。
在下文中一共展示了Artifact.getExt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publishChecks
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public void publishChecks(DependencyResolver resolver, Artifact artifact, File file)
throws IOException {
if (pgpSigner != null) {
final String ext = artifact.getExt();
final Artifact signArtifact = withExtension(artifact, ext + ".asc");
final File signedFile = new File(file.getPath() + ".asc");
if (!signedFile.exists()) {
JkLog.info("Signing file " + file.getPath() + " on detached signature "
+ signedFile.getPath());
pgpSigner.sign(file.toPath());
}
resolver.publish(signArtifact, signedFile, true);
}
}
示例2: DefaultLocalArtifactMetaData
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
private DefaultLocalArtifactMetaData(ComponentIdentifier componentIdentifier, String displayName, Artifact artifact, File file) {
this.componentIdentifier = componentIdentifier;
Map<String, String> attrs = new HashMap<String, String>();
attrs.putAll(artifact.getExtraAttributes());
attrs.put("file", file == null ? "null" : file.getAbsolutePath());
this.id = new DefaultLocalArtifactIdentifier(componentIdentifier, displayName, artifact.getName(), artifact.getType(), artifact.getExt(), attrs);
this.artifact = artifact;
this.file = file;
}
示例3: transform
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public static Artifact transform(Artifact artifact, NamespaceTransformer t) {
if (t.isIdentity()) {
return artifact;
}
ModuleRevisionId mrid = t.transform(artifact.getModuleRevisionId());
if (artifact.getModuleRevisionId().equals(mrid)) {
return artifact;
}
return new DefaultArtifact(mrid, artifact.getPublicationDate(), artifact.getName(),
artifact.getType(), artifact.getExt(), artifact.getUrl(),
artifact.getQualifiedExtraAttributes());
}
示例4: DefaultIvyArtifactName
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public DefaultIvyArtifactName(Artifact a) {
this(a.getName(), a.getType(), a.getExt(), a.getAttributes());
}
示例5: DefaultModuleComponentArtifactIdentifier
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public DefaultModuleComponentArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, Artifact artifact) {
this(componentIdentifier, artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getExtraAttributes());
}
示例6: DefaultModuleVersionArtifactIdentifier
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public DefaultModuleVersionArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, Artifact artifact) {
this(componentIdentifier, artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getExtraAttributes());
}
示例7: progress
import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public void progress(IvyEvent event) {
PublishEventsTest test = (PublishEventsTest) IvyContext.getContext().peek(
PublishEventsTest.class.getName());
InstrumentedResolver resolver = (InstrumentedResolver) test.ivy.getSettings()
.getResolver("default");
assertNotNull("instrumented resolver configured", resolver);
assertNotNull("got a reference to the current unit test case", test);
// test the proper sequence of events by comparing the number of pre-events,
// post-events, and actual publications.
assertTrue("event is of correct base type", event instanceof PublishEvent);
PublishEvent pubEvent = (PublishEvent) event;
Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
File expectedData = test.currentTestCase.expectedData;
assertSameArtifact("event records correct artifact", expectedArtifact,
pubEvent.getArtifact());
try {
assertEquals("event records correct file", expectedData.getCanonicalPath(),
pubEvent.getData().getCanonicalPath());
assertEquals("event records correct overwrite setting", test.expectedOverwrite,
pubEvent.isOverwrite());
assertSame("event presents correct resolver", resolver, pubEvent.getResolver());
String[] attributes = {"organisation", "module", "revision", "artifact", "type",
"ext", "resolver", "overwrite"};
String[] values = {"apache", "PublishEventsTest", "1.0-dev",
expectedArtifact.getName(), expectedArtifact.getType(),
expectedArtifact.getExt(), "default",
String.valueOf(test.expectedOverwrite)};
for (int i = 0; i < attributes.length; ++i) {
assertEquals("event declares correct value for " + attributes[i], values[i],
event.getAttributes().get(attributes[i]));
}
// we test file separately, since it is hard to guarantee an exact path match, but
// we want to make sure that both paths point to the same canonical location on the
// filesystem
String filePath = event.getAttributes().get("file");
assertEquals("event declares correct value for file",
expectedData.getCanonicalPath(), new File(filePath).getCanonicalPath());
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}