Value dependencyUri )
throws RepositoryException, MalformedQueryException, QueryEvaluationException
{
TupleQuery tq = repositoryConnection.prepareTupleQuery( QueryLanguage.SERQL, dependencyQuery );
tq.setBinding( "x", dependencyUri );
TupleQueryResult dependencyResult = tq.evaluate();
try
{
while ( dependencyResult.hasNext() )
{
ProjectDependency projectDependency = new ProjectDependency();
BindingSet bs = dependencyResult.next();
projectDependency.setGroupId( bs.getBinding( ProjectUri.GROUP_ID.getObjectBinding() ).getValue().toString() );
projectDependency.setArtifactId( bs.getBinding( ProjectUri.ARTIFACT_ID.getObjectBinding() ).getValue().toString() );
projectDependency.setVersion( bs.getBinding( ProjectUri.VERSION.getObjectBinding() ).getValue().toString() );
projectDependency.setArtifactType( bs.getBinding( ProjectUri.ARTIFACT_TYPE.getObjectBinding() ).getValue().toString() );
Binding classifierBinding = bs.getBinding( ProjectUri.CLASSIFIER.getObjectBinding() );
if ( classifierBinding != null )
{
projectDependency.setPublicKeyTokenId( classifierBinding.getValue().toString().replace( ":", "" ) );
}
project.addProjectDependency( projectDependency );
if ( bs.hasBinding( ProjectUri.DEPENDENCY.getObjectBinding() ) )
{
addDependenciesToProject( projectDependency, repositoryConnection,
bs.getValue( ProjectUri.DEPENDENCY.getObjectBinding() ) );
}
}
}
finally
{
dependencyResult.close();
}
}