/** * Get a Propstat instance contained within this response that has the * provided criteria, or create a new Propstat instance with the provided * information if no propstat already exists. * * @param status the Http status code of the propstat to retrieve * @param description the description of the propstat to retrieve * @param error the error of the propstat to retrieve. Note that when * searching for a matching propstat, errors are considered the * same only if both errors are null. * @return */ public Propstat getOrCreatePropstat(int status, String description, Error error) { Propstat propstat = getPropstat(status, description, error); if (propstat == null) { propstat = new Propstat(); propstat.setProp(new Prop()); propstat.setStatus(HttpStatus.valueOf(status).getStatusLine()); propstat.setResponsedescription(description); propstat.setError(error); getPropstat().add(propstat); } return propstat; }