Java Code Examples for org.apache.ivy.core.module.descriptor.Artifact#getName()
The following examples show how to use
org.apache.ivy.core.module.descriptor.Artifact#getName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultLocalComponentMetaData.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
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; }
Example 2
Source File: DefaultLocalComponentMetaData.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
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; }
Example 3
Source File: NameSpaceHelper.java From ant-ivy with Apache License 2.0 | 5 votes |
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()); }
Example 4
Source File: DefaultIvyArtifactName.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
public DefaultIvyArtifactName(Artifact a) { this(a.getName(), a.getType(), a.getExt(), a.getAttributes()); }
Example 5
Source File: DefaultModuleComponentArtifactIdentifier.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
public DefaultModuleComponentArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, Artifact artifact) { this(componentIdentifier, artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getExtraAttributes()); }
Example 6
Source File: DefaultModuleVersionArtifactIdentifier.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
public DefaultModuleVersionArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, Artifact artifact) { this(componentIdentifier, artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getExtraAttributes()); }
Example 7
Source File: DefaultIvyArtifactName.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public DefaultIvyArtifactName(Artifact a) { this(a.getName(), a.getType(), a.getExt(), a.getAttributes()); }
Example 8
Source File: DefaultModuleComponentArtifactIdentifier.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public DefaultModuleComponentArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, Artifact artifact) { this(componentIdentifier, artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getExtraAttributes()); }
Example 9
Source File: DefaultModuleVersionArtifactIdentifier.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public DefaultModuleVersionArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, Artifact artifact) { this(componentIdentifier, artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getExtraAttributes()); }
Example 10
Source File: PublishEventsTest.java From ant-ivy with Apache License 2.0 | 4 votes |
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); } }