private String getAllElementAttributes(final InputStream input, final String name, final OutputStream os) { final ByteArrayOutputStream attrs = new ByteArrayOutputStream(); String res; try { byte[] attrsDeclaration = null; final String key = "<" + name + " "; if (consume(input, key, os, true) >= 0 && consume(input, ">", attrs, false) >= 0) { attrsDeclaration = attrs.toByteArray(); os.write(attrsDeclaration); os.write('>'); } res = attrsDeclaration == null ? "" : new String(attrsDeclaration, Constants.UTF8).trim(); } catch (Exception e) { LOG.error("Error retrieving entities from EntitySet", e); res = ""; } return res.endsWith("/") ? res.substring(0, res.length() - 1) : res; }
private String getAllElementAttributes(final InputStream input, final String name, final OutputStream os) { final ByteArrayOutputStream attrs = new ByteArrayOutputStream(); String res; try { byte[] attrsDeclaration = null; final String key = "<" + name + " "; if (consume(input, key, os, true) >= 0 && consume(input, ">", attrs, false) >= 0) { attrsDeclaration = attrs.toByteArray(); os.write(attrsDeclaration); os.write('>'); } res = attrsDeclaration == null ? "" : new String(attrsDeclaration, Constants.UTF8).trim(); } catch (Exception e) { LOG.error("Error retrieving entities from EntitySet", e); res = ""; } return res.endsWith("/") ? res.substring(0, res.length() - 1) : res; }
private ResWrap<Entity> nextAtomEntityFromEntitySet( final InputStream input, final OutputStream osEntitySet, final String namespaces) { final ByteArrayOutputStream entity = new ByteArrayOutputStream(); ResWrap<Entity> atomEntity = null; try { if (consume(input, "<entry>", osEntitySet, false) >= 0) { entity.write("<entry ".getBytes(Constants.UTF8)); entity.write(namespaces.getBytes(Constants.UTF8)); entity.write(">".getBytes(Constants.UTF8)); if (consume(input, "</entry>", entity, true) >= 0) { atomEntity = odataClient.getDeserializer(ContentType.APPLICATION_ATOM_XML). toEntity(new ByteArrayInputStream(entity.toByteArray())); } } } catch (Exception e) { LOG.error("Error retrieving entities from EntitySet", e); } return atomEntity; }
private ResWrap<Entity> nextAtomEntityFromEntitySet( final InputStream input, final OutputStream osEntitySet, final String namespaces) { final ByteArrayOutputStream entity = new ByteArrayOutputStream(); ResWrap<Entity> atomEntity = null; try { if (consume(input, "<entry>", osEntitySet, false) >= 0) { entity.write("<entry ".getBytes(Constants.UTF8)); entity.write(namespaces.getBytes(Constants.UTF8)); entity.write(">".getBytes(Constants.UTF8)); if (consume(input, "</entry>", entity, true) >= 0) { atomEntity = odataClient.getDeserializer(ContentType.APPLICATION_ATOM_XML). toEntity(new ByteArrayInputStream(entity.toByteArray())); } } } catch (Exception e) { LOG.error("Error retrieving entities from EntitySet", e); } return atomEntity; }
namespaces = null; try { if (consume(stream, "\"value\":", osEntitySet, true) >= 0) { int c = 0; while (c != '[' && (c = stream.read()) >= 0) {
namespaces = null; try { if (consume(stream, "\"value\":", osEntitySet, true) >= 0) { int c = 0; while (c != '[' && (c = stream.read()) >= 0) {