}
public <T> T get(String id, Class<T> type)
throws StoreException
{
HTTPRequest request = pool.slash(id).get();
try {
request.accept(type);
try {
request.execute();
if (request.isNotModified()) {
return null;
}
}
catch (NotFound e) {
return null;
}
catch (UnsupportedQueryLanguage e) {
throw new UnsupportedQueryLanguageException(e);
}
catch (UnsupportedFileFormat e) {
throw new UnsupportedRDFormatException(e);
}
catch (UnsupportedMediaType e) {
throw new UnsupportedRDFormatException(e);
}
catch (Unauthorized e) {
throw new UnauthorizedException(e);
}
catch (HTTPException e) {
throw new StoreException(e);
}
return request.read(type);
}
catch (IOException e) {
throw new StoreException(e);
}
catch (NumberFormatException e) {
throw new StoreException(e);
}
catch (QueryResultParseException e) {
throw new StoreException(e);
}
catch (RDFParseException e) {
throw new StoreException(e);
}
catch (NoCompatibleMediaType e) {
throw new StoreException(e);
}
finally {
request.release();
}
}