/** * Pushes a new value to the the requested path. * Same as: {@code set( path + "/" + createKey(), json)} * * @param path to the object or value to set * @param json value to set it to, can be a json primitive or struct * @return the field name that was added to the path object */ default String push(String path, String json) { return push(path, json.getBytes(StandardCharsets.UTF_8)); }
/** * Pushes a new value to the the requested path. * Same as: {@code set( path + "/" + createKey(), json)} * * @param path to the object or value to set * @param json value to set it to, can be a json primitive or struct * @return the field name that was added to the path object */ default String push(String path, String json) { return push(path, json.getBytes(StandardCharsets.UTF_8)); }
default String push(String path, byte[] json) { return push(path, new ByteArrayInputStream(json)); }
default String push(String path, byte[] json) { return push(path, new ByteArrayInputStream(json)); }
@Path("/{path: .*}.json") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @POST public Map<String, String> push(@PathParam("path") String path, InputStream body) { Map<String, String> result = new HashMap<>(); result.put("name", jsondb.push(path, body)); return result; }
@Path("/{path: .*}.json") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @POST public HashMap<String, String> push(@PathParam("path") String path, InputStream body) { HashMap<String, String> result = new HashMap<>(); result.put("name", jsondb.push(path, body)); return result; }