/**
* This version is different as we need to re-write the filename with the
* timestamp for the latest version.
*
* @param key
* IndexKey to find the Artifact in the Index
* @param filename
* Filename from the request
* @return StreamingOutput from the Storage Layer
*/
protected StreamingOutput getSnapshotArtifact(JavaIndexKey key, String filename)
{
logger.info("[Downloading Snapshot] " + key);
try
{
if (getIndex().isArtifact(key))
{
JavaIndexArtifact ia = (JavaIndexArtifact) getIndex().getArtifact(key);
String snapshotFilename = filename.replace(key.getVersion(), ia.getSnapshotVersion());
return getStorage().getArtifactStream(ia, snapshotFilename);
}
else
{
throw new NotFoundException();
}
}
catch (IndexException ie)
{
throw new InternalServerErrorException();
}
}
JavaRepository.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:hangar
作者:
评论列表
文章目录