@SuppressWarnings("unchecked") public Object getContent(DataSource ds) throws IOException { // Get the input properties to use when parsing content InputProperties inputProperties = getThreadInputProperties(); // Find the parser to handle the input content type ContentType contentType = new ContentType(ds.getContentType()); AltRegistry altRegistry = inputProperties.getAltRegistry(); AltFormat altFormat = altRegistry.lookupType(contentType); InputParser<?> parser = altRegistry.getParser(altFormat); if (parser == null) { throw new IOException("Invalid multipart content: " + contentType); } try { return parseAtom(parser, ds.getInputStream(), contentType, inputProperties, inputProperties.getRootType()); } catch (ServiceException se) { IOException ioe = new IOException("Error parsing content"); ioe.initCause(se); throw ioe; } }
@SuppressWarnings("unchecked") public Object getContent(DataSource ds) throws IOException { // Get the input properties to use when parsing content InputProperties inputProperties = getThreadInputProperties(); // Find the parser to handle the input content type ContentType contentType = new ContentType(ds.getContentType()); AltRegistry altRegistry = inputProperties.getAltRegistry(); AltFormat altFormat = altRegistry.lookupType(contentType); InputParser<?> parser = altRegistry.getParser(altFormat); if (parser == null) { throw new IOException("Invalid multipart content: " + contentType); } try { return parseAtom(parser, ds.getInputStream(), contentType, inputProperties, inputProperties.getRootType()); } catch (ServiceException se) { IOException ioe = new IOException("Error parsing content"); ioe.initCause(se); throw ioe; } }