if (repoId != null && itemPath != null) {
try {
final MavenRepository repository = repositoryRegistry
.getRepositoryWithFacet(repoId, MavenRepository.class);
if (repository != null) {
final Gav gav = repository.getGavCalculator().pathToGav(itemPath);
if (gav != null && !gav.isSignature() && !gav.isHash()) {
// Hack: we mutate the entry, but putting in gav for reuse
if (!Strings.isNullOrEmpty(gav.getClassifier())) {
input.getData().put("itemGav", String
.format("%s:%s:%s:%s:%s", gav.getGroupId(), gav.getArtifactId(), gav.getVersion(),
gav.getExtension(), gav.getClassifier()));
}
else {
input.getData().put("itemGav", String
.format("%s:%s:%s:%s", gav.getGroupId(), gav.getArtifactId(), gav.getVersion(),
gav.getExtension()));
}
return true;
}
}
}