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


Java Artifact.getName方法代码示例

本文整理汇总了Java中org.apache.ivy.core.module.descriptor.Artifact.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Artifact.getName方法的具体用法?Java Artifact.getName怎么用?Java Artifact.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ivy.core.module.descriptor.Artifact的用法示例。


在下文中一共展示了Artifact.getName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isArtifactName

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
private boolean isArtifactName(Artifact artifact, String name, Collection<String> suffixes,
        String type) {
    String artifactNameToMatch = artifact.getExtraAttribute(IVYDE_NS_PREFIX + type);
    if (artifactNameToMatch != null) {
        // some name is specified, it overrides suffix matching
        return name.equals(artifactNameToMatch);
    }
    String jar = artifact.getName();
    if (name.equals(jar)) {
        return true;
    }
    for (String suffix : suffixes) {
        if (name.equals(jar + suffix)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:19,代码来源:IvyClasspathContainerMapper.java

示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultLocalComponentMetaData.java

示例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());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:13,代码来源:NameSpaceHelper.java

示例4: withExtension

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private static Artifact withExtension(Artifact ar, String ext) {
    return new DefaultArtifact(ar.getModuleRevisionId(), ar.getPublicationDate(), ar.getName(),
            ar.getType(), ext, ar.getUrl(), new HashMap(ar.getExtraAttributes()));
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:6,代码来源:IvyPublisher.java

示例5: DefaultIvyArtifactName

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public DefaultIvyArtifactName(Artifact a) {
    this(a.getName(), a.getType(), a.getExt(), a.getAttributes());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:DefaultIvyArtifactName.java

示例6: 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());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:DefaultModuleComponentArtifactIdentifier.java

示例7: 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());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:DefaultModuleVersionArtifactIdentifier.java

示例8: 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);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:49,代码来源:PublishEventsTest.java


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