w.GetDatastream(datastreamId, null); if (orig == null) { throw new DatastreamNotFoundException("Object " + pid + " has no datastream " + datastreamId + " to modify");
+ " (actionLabel=" + actionLabel + ")", e); throw new NotFound404Exception("", e, request, actionLabel, e .getMessage(), EMPTY_STRING_ARRAY); } catch (ObjectNotFoundException e) { logger.error("Object not found for request: " + requestURI
throw new DatastreamNotFoundException("Datastream " + dsID + " not found");
+ " (actionLabel=" + actionLabel + ")", e); throw new NotFound404Exception("", e, request, actionLabel, e .getMessage(), EMPTY_STRING_ARRAY); } catch (ObjectNotFoundException e) { logger.error("Object not found for request: " + requestURI
throw new DatastreamNotFoundException("Datastream " + dsID + " not found");
EMPTY_STRING_ARRAY); } catch (DatastreamNotFoundException e) { logger.error("Datastream not found: " + pid + "/" + dsID + " - " + e.getMessage()); throw new NotFound404Exception(request, actionLabel, e.getMessage(), EMPTY_STRING_ARRAY);
w.GetDatastream(datastreamId, null); if (orig == null) { throw new DatastreamNotFoundException("Object " + pid + " has no datastream " + datastreamId + " to modify");
EMPTY_STRING_ARRAY); } catch (DatastreamNotFoundException e) { logger.error("Datastream not found: " + pid + "/" + dsID + " - " + e.getMessage()); throw new NotFound404Exception(request, actionLabel, e.getMessage(), EMPTY_STRING_ARRAY);
protected DatastreamXMLMetadata getWSDLDatastream(Date versDateTime) throws DatastreamNotFoundException, ObjectIntegrityException { Datastream ds = GetDatastream("WSDL", versDateTime); if (ds == null) { throw new DatastreamNotFoundException("The object, " + GetObjectPID() + " does not have a WSDL datastream" + " existing at " + getWhenString(versDateTime)); } DatastreamXMLMetadata wsdlDS = null; try { wsdlDS = (DatastreamXMLMetadata) ds; } catch (Throwable th) { throw new ObjectIntegrityException("The object, " + GetObjectPID() + " has a WSDL datastream existing at " + getWhenString(versDateTime) + ", but it's not an " + "XML metadata datastream"); } return wsdlDS; }
protected DatastreamXMLMetadata getWSDLDatastream(Date versDateTime) throws DatastreamNotFoundException, ObjectIntegrityException { Datastream ds = GetDatastream("WSDL", versDateTime); if (ds == null) { throw new DatastreamNotFoundException("The object, " + GetObjectPID() + " does not have a WSDL datastream" + " existing at " + getWhenString(versDateTime)); } DatastreamXMLMetadata wsdlDS = null; try { wsdlDS = (DatastreamXMLMetadata) ds; } catch (Throwable th) { throw new ObjectIntegrityException("The object, " + GetObjectPID() + " has a WSDL datastream existing at " + getWhenString(versDateTime) + ", but it's not an " + "XML metadata datastream"); } return wsdlDS; }
protected DatastreamXMLMetadata getMethodMapDatastream(Date versDateTime) throws DatastreamNotFoundException, ObjectIntegrityException { Datastream ds = GetDatastream("METHODMAP", versDateTime); if (ds == null) { throw new DatastreamNotFoundException("The object, " + GetObjectPID() + " does not have a METHODMAP datastream" + " existing at " + getWhenString(versDateTime)); } DatastreamXMLMetadata mmapDS = null; try { mmapDS = (DatastreamXMLMetadata) ds; } catch (Throwable th) { throw new ObjectIntegrityException("The object, " + GetObjectPID() + " has a METHODMAP datastream existing at " + getWhenString(versDateTime) + ", but it's not an " + "XML metadata datastream"); } return mmapDS; }
w.GetDatastream(datastreamId, null); if (orig == null) { throw new DatastreamNotFoundException("Object " + pid + " has no datastream " + datastreamId + " to modify");
protected DatastreamXMLMetadata getMethodMapDatastream(Date versDateTime) throws DatastreamNotFoundException, ObjectIntegrityException { Datastream ds = GetDatastream("METHODMAP", versDateTime); if (ds == null) { throw new DatastreamNotFoundException("The object, " + GetObjectPID() + " does not have a METHODMAP datastream" + " existing at " + getWhenString(versDateTime)); } DatastreamXMLMetadata mmapDS = null; try { mmapDS = (DatastreamXMLMetadata) ds; } catch (Throwable th) { throw new ObjectIntegrityException("The object, " + GetObjectPID() + " has a METHODMAP datastream existing at " + getWhenString(versDateTime) + ", but it's not an " + "XML metadata datastream"); } return mmapDS; }
w.GetDatastream(datastreamId, null); if (orig == null) { throw new DatastreamNotFoundException("Object " + pid + " has no datastream " + datastreamId + " to modify");
protected DatastreamXMLMetadata getDSInputSpecDatastream(Date versDateTime) throws DatastreamNotFoundException, ObjectIntegrityException { Datastream ds = GetDatastream("DSINPUTSPEC", versDateTime); if (ds == null) { throw new DatastreamNotFoundException("The object, " + GetObjectPID() + " does not have a DSINPUTSPEC datastream" + " existing at " + getWhenString(versDateTime)); } DatastreamXMLMetadata dsInSpecDS = null; try { dsInSpecDS = (DatastreamXMLMetadata) ds; } catch (Throwable th) { throw new ObjectIntegrityException("The object, " + GetObjectPID() + " has a DSINPUTSPEC datastream existing at " + getWhenString(versDateTime) + ", but it's not an " + "XML metadata datastream"); } return dsInSpecDS; } }
protected DatastreamXMLMetadata getDSInputSpecDatastream(Date versDateTime) throws DatastreamNotFoundException, ObjectIntegrityException { Datastream ds = GetDatastream("DSINPUTSPEC", versDateTime); if (ds == null) { throw new DatastreamNotFoundException("The object, " + GetObjectPID() + " does not have a DSINPUTSPEC datastream" + " existing at " + getWhenString(versDateTime)); } DatastreamXMLMetadata dsInSpecDS = null; try { dsInSpecDS = (DatastreamXMLMetadata) ds; } catch (Throwable th) { throw new ObjectIntegrityException("The object, " + GetObjectPID() + " has a DSINPUTSPEC datastream existing at " + getWhenString(versDateTime) + ", but it's not an " + "XML metadata datastream"); } return dsInSpecDS; } }
+ DateUtility.convertDateToString(asOfDateTime) + " \" ."; throw new DatastreamNotFoundException(message);
+ DateUtility.convertDateToString(asOfDateTime) + " \" ."; throw new DatastreamNotFoundException(message);
@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()); }