private InputStream getStoredObjectInputStream(String pid) throws ObjectNotFoundException { try { return new FileInputStream((File) m_files.get(pid)); } catch (Throwable th) { throw new ObjectNotFoundException("The object, " + pid + " was " + "not found in the repository."); } }
results = s2.executeQuery(); if (!results.next()) { throw new ObjectNotFoundException("Error creating replication job: The requested object doesn't exist in the registry."); } catch (ObjectNotFoundException e) { e.printStackTrace(); } finally { try {
+ " (actionLabel=" + actionLabel + ")", e); throw new NotFound404Exception("", e, request, actionLabel, e .getMessage(), EMPTY_STRING_ARRAY); } catch (DisseminationException e) { logger.error("Dissemination failed: " + requestURI
results = s2.executeQuery(); if (!results.next()) { throw new ObjectNotFoundException("Error creating replication job: The requested object doesn't exist in the registry."); } catch (ObjectNotFoundException e) { e.printStackTrace(); } finally { try {
+ " (actionLabel=" + actionLabel + ")", e); throw new NotFound404Exception("", e, request, actionLabel, e .getMessage(), EMPTY_STRING_ARRAY); } catch (DisseminationException e) { logger.error("Dissemination failed: " + requestURI
private InputStream getStoredObjectInputStream(String pid) throws ObjectNotFoundException { try { return new FileInputStream((File) m_files.get(pid)); } catch (Throwable th) { throw new ObjectNotFoundException("The object, " + pid + " was " + "not found in the repository."); } }
logger.error("Object not found: " + pid + " - " + e.getMessage()); throw new NotFound404Exception(request, actionLabel, e.getMessage(), EMPTY_STRING_ARRAY); } catch (DatastreamNotFoundException e) {
/** * Get a <code>DigitalObject</code> if it's in the "repository". * * @throws ObjectNotFoundException * if it's not in the "repository". */ public synchronized DigitalObject getObject(String pid) throws ObjectNotFoundException { DigitalObject obj = _objects.get(pid); if (obj == null) { throw new ObjectNotFoundException("No such object: " + pid); } else { return obj; } }
logger.error("Object not found: " + pid + " - " + e.getMessage()); throw new NotFound404Exception(request, actionLabel, e.getMessage(), EMPTY_STRING_ARRAY); } catch (DatastreamNotFoundException e) {
w = m_manager.getWriter(false, context, pid); } catch (ObjectNotInLowlevelStorageException e ){ throw new ObjectNotFoundException("Object " + pid + " does not exist.");
w = m_manager.getWriter(false, context, pid); } catch (ObjectNotInLowlevelStorageException e ){ throw new ObjectNotFoundException("Object " + pid + " does not exist.");
results = s.executeQuery(); if (!results.next()) { throw new ObjectNotFoundException( "Error creating replication job: The requested object " + pid + " doesn't exist in the registry.");
results = s.executeQuery(); if (!results.next()) { throw new ObjectNotFoundException( "Error creating replication job: The requested object " + pid + " doesn't exist in the registry.");
@Test public void testExceptionResponses() throws Exception { Response output = null; output = test.handleException(new ObjectNotFoundException("This is testing exception handling"), false); assertEquals(HttpStatus.SC_NOT_FOUND, output.getStatus()); output = test.handleException(new ObjectNotInLowlevelStorageException("This is testing exception handling"), false); assertEquals(HttpStatus.SC_NOT_FOUND, output.getStatus()); output = test.handleException(new DatastreamNotFoundException("This is testing exception handling"), false); assertEquals(HttpStatus.SC_NOT_FOUND, output.getStatus()); output = test.handleException(new ObjectLockedException("This is testing exception handling"), false); assertEquals(HttpStatus.SC_CONFLICT, output.getStatus()); output = test.handleException(new DatastreamLockedException("This is testing exception handling"), false); assertEquals(HttpStatus.SC_CONFLICT, output.getStatus()); output = test.handleException(new RangeNotSatisfiableException("This is testing exception handling"), false); assertEquals(HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE, output.getStatus()); }