String path = repository.pathOf( artifact );
switch ( ManagedArtifactTypes.whichType( artifact.getType() ) )
{
case ManagedArtifactTypes.EJB:
ManagedEjbArtifact managedEjbArtifact = new ManagedEjbArtifact( repository.getId(), artifact, path );
managedEjbArtifact.setJavadocPath( pathToRelatedArtifact( repository, artifact, "javadoc", "jar" ) );
managedEjbArtifact.setSourcesPath( pathToRelatedArtifact( repository, artifact, "sources", "jar" ) );
managedEjbArtifact.setClientPath( pathToRelatedArtifact( repository, artifact, "client", "jar" ) );
return managedEjbArtifact;
case ManagedArtifactTypes.JAVA:
ManagedJavaArtifact managedJavaArtifact = new ManagedJavaArtifact( repository.getId(), artifact, path );