throws ResourceException
{
String key = request.getAttributes().get(GlobalConfigurationPlexusResource.CONFIG_NAME_KEY).toString();
try {
NexusStreamResponse result;
if (!getNexusConfiguration().getConfigurationFiles().containsKey(key)) {
throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "No configuration with key '" + key
+ "' found!");
}
else {
result = getNexusConfiguration().getConfigurationAsStreamByKey(key);
}
// TODO: make this real resource being able to be polled (ETag and last modified support)
return new InputStreamRepresentation(MediaType.valueOf(result.getMimeType()), result.getInputStream());
}
catch (IOException e) {
throw new ResourceException(Status.SERVER_ERROR_INTERNAL, "IOException during configuration retrieval!", e);
}
}