protected void writeAclXML(Acl acl, CmisVersion cmisVersion, OutputStream out) throws XMLStreamException { XMLStreamWriter writer = XMLUtils.createWriter(out); XMLUtils.startXmlDocument(writer); XMLConverter.writeAcl(writer, cmisVersion, true, acl); XMLUtils.endXmlDocument(writer); } }
@Override public void write(OutputStream out) throws Exception { XmlSerializer writer = XMLUtils.createWriter(out); XMLUtils.startXmlDocument(writer); XMLConverter.writeQuery(writer, cmisVersion, query); XMLUtils.endXmlDocument(writer); } });
/** * Generates a valid Atom id. */ public String generateAtomId(String input) { if (input == null) { return ID_DUMMY; } return ID_PREFIX + Base64.encodeBytes(IOUtils.toUTF8Bytes(input)); }
/** * Writes a DateTime tag. */ public static void write(XmlSerializer writer, String prefix, String namespace, String tag, GregorianCalendar value) throws IOException { assert writer != null; if (value == null) { return; } write(writer, prefix, namespace, tag, DateTimeHelper.formatXmlDateTime(value)); }
/** * Closes the Atom content stream. */ private void closeAtomContentStream() { IOUtils.closeQuietly(atomContentStream); atomContentStream = null; }
public static <T extends Enum<T>> T getIntEnum(final Map<String, Object> json, final String key, final Class<T> clazz) { return CmisEnumHelper.fromValue(getInteger(json, key), clazz); } }
@Override public void write(OutputStream out) throws IOException { IOUtils.copy(stream, out); } });
/** * Converts a Web Services extension extension into a binding holder. */ public static ExtensionsData convertExtensionHolder(javax.xml.ws.Holder<CmisExtensionType> extension) { if (extension == null) { return null; } return convert(extension.value); }
/** * Reads all lines from a stream and closes the stream. * * @param stream * the input stream */ public static String readAllLines(InputStream stream) throws IOException { return readAllLines(stream, Integer.MAX_VALUE); }
/** * Reads all lines from a stream, ignores all comments, and closes the * stream. * * @param stream * the input stream */ public static List<String> readAllLinesAsList(InputStream stream) throws IOException { return readAllLinesAsList(stream, Integer.MAX_VALUE); }
/** * Suspends encoding of the stream. May be helpful if you need to embed * a piece of base64-encoded data in a stream. * * @throws java.io.IOException * if there's an error flushing * @since 1.5.1 */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; } // end suspendEncoding
@Override public void write(OutputStream out) throws Exception { XMLStreamWriter writer = XMLUtils.createWriter(out); XMLUtils.startXmlDocument(writer); XMLConverter.writeAcl(writer, cmisVersion, true, acl); XMLUtils.endXmlDocument(writer); } });
@Override public void write(OutputStream out) throws Exception { XMLStreamWriter writer = XMLUtils.createWriter(out); XMLUtils.startXmlDocument(writer); XMLConverter.writeQuery(writer, cmisVersion, query); XMLUtils.endXmlDocument(writer); } });
/** * Writes a DateTime tag. */ public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, GregorianCalendar value) throws XMLStreamException { assert writer != null; if (value == null) { return; } write(writer, prefix, namespace, tag, DateTimeHelper.formatXmlDateTime(value)); }
/** * Closes the CMIS content stream. */ private void closeCmisContentStream() { IOUtils.closeQuietly(cmisContentStream); cmisContentStream = null; }
public static <T extends Enum<T>> T getIntEnum(final Map<String, Object> json, final String key, final Class<T> clazz) { return CmisEnumHelper.fromValue(getInteger(json, key), clazz); } }
@Override public void write(OutputStream out) throws Exception { XmlSerializer writer = XMLUtils.createWriter(out); XMLUtils.startXmlDocument(writer); XMLConverter.writeAcl(writer, cmisVersion, true, acl); XMLUtils.endXmlDocument(writer); } });