@Path("download/{id}/{version}")
public Response getPackage(@PathParam("id") String id,
@PathParam("version") String versionString) {
try {
Version version = Version.parse(versionString);
PackageSource packageSource = getPackageSource();
if (packageSource == null) {
return Response.status(Response.Status.NOT_FOUND).build();
}
Nupkg nupkg = packageSource.getPackage(id, version);
if (nupkg == null) {
logger.warn("Пакет " + id + ":" + versionString + " не найден");
return Response.status(Response.Status.NOT_FOUND).build();
}
InputStream inputStream = nupkg.getStream();