public boolean bufferEntity() throws MessageProcessingException { checkEntityIsClosed(); if (!entityBufferred && entity instanceof InputStream) { try { InputStream oldEntity = (InputStream)entity; entity = IOUtils.loadIntoBAIS(oldEntity); oldEntity.close(); entityBufferred = true; } catch (IOException ex) { throw new MessageProcessingException(ex); } } return entityBufferred; }
public boolean bufferEntity() throws ProcessingException { checkEntityIsClosed(); if (!entityBufferred && entity instanceof InputStream) { try { InputStream oldEntity = (InputStream)entity; entity = IOUtils.loadIntoBAIS(oldEntity); oldEntity.close(); entityBufferred = true; } catch (IOException ex) { throw new ResponseProcessingException(this, ex); } } return entityBufferred; }
private void loadSchemasIntoCache(String loc) throws Exception { InputStream is = ResourceUtils.getResourceStream(loc, bus == null ? BusFactory.getDefaultBus() : bus); if (is == null) { return; } try (ByteArrayInputStream bis = IOUtils.loadIntoBAIS(is)) { XMLSource source = new XMLSource(bis); source.setBuffering(); String targetNs = source.getValue("/*/@targetNamespace"); Map<String, String> nsMap = Collections.singletonMap("xs", Constants.URI_2001_SCHEMA_XSD); String[] elementNames = source.getValues("/*/xs:element/@name", nsMap); externalQnamesMap.put(targetNs, Arrays.asList(elementNames)); String schemaValue = source.getNode("/xs:schema", nsMap, String.class); externalSchemasCache.add(schemaValue); } }
private void loadSchemasIntoCache(String loc) throws Exception { InputStream is = ResourceUtils.getResourceStream(loc, bus == null ? BusFactory.getDefaultBus() : bus); if (is == null) { return; } ByteArrayInputStream bis = IOUtils.loadIntoBAIS(is); XMLSource source = new XMLSource(bis); source.setBuffering(); String targetNs = source.getValue("/*/@targetNamespace"); Map<String, String> nsMap = Collections.singletonMap("xs", XmlSchemaConstants.XSD_NAMESPACE_URI); String[] elementNames = source.getValues("/*/xs:element/@name", nsMap); externalQnamesMap.put(targetNs, Arrays.asList(elementNames)); String schemaValue = source.getNode("/xs:schema", nsMap, String.class); externalSchemasCache.add(schemaValue); }
private void loadSchemasIntoCache(String loc) throws Exception { InputStream is = ResourceUtils.getResourceStream(loc, bus == null ? BusFactory.getDefaultBus() : bus); if (is == null) { return; } try (ByteArrayInputStream bis = IOUtils.loadIntoBAIS(is)) { XMLSource source = new XMLSource(bis); source.setBuffering(); String targetNs = source.getValue("/*/@targetNamespace"); Map<String, String> nsMap = Collections.singletonMap("xs", Constants.URI_2001_SCHEMA_XSD); String[] elementNames = source.getValues("/*/xs:element/@name", nsMap); externalQnamesMap.put(targetNs, Arrays.asList(elementNames)); String schemaValue = source.getNode("/xs:schema", nsMap, String.class); externalSchemasCache.add(schemaValue); } }
InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream()); in.setByteStream(ins); } catch (IOException e) {
InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream()); in.setByteStream(ins); } catch (IOException e) {
InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream()); in.setByteStream(ins); } catch (IOException e) {
InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream()); in.setByteStream(ins); } catch (IOException e) {