Package org.apache.sling.rewriter.impl.components

Examples of org.apache.sling.rewriter.impl.components.XMLSerializerFactory$XMLSerializer


  }

 
  public static void write(EpubWriter epubWriter, Book book, ZipOutputStream resultStream) throws IOException {
    resultStream.putNextEntry(new ZipEntry(book.getSpine().getTocResource().getHref()));
    XmlSerializer out = EpubProcessorSupport.createXmlSerializer(resultStream);
    write(out, book);
    out.flush();
  }
View Full Code Here


  public static Resource createNCXResource(Book book) throws IllegalArgumentException, IllegalStateException, IOException {
    return createNCXResource(book.getMetadata().getIdentifiers(), book.getTitle(), book.getMetadata().getAuthors(), book.getTableOfContents());
  }
  public static Resource createNCXResource(List<Identifier> identifiers, String title, List<Author> authors, TableOfContents tableOfContents) throws IllegalArgumentException, IllegalStateException, IOException {
    ByteArrayOutputStream data = new ByteArrayOutputStream();
    XmlSerializer out = EpubProcessorSupport.createXmlSerializer(data);
    write(out, identifiers, title, authors, tableOfContents);
    Resource resource = new Resource(NCX_ITEM_ID, data.toByteArray(), DEFAULT_NCX_HREF, MediatypeService.NCX);
    return resource;
 
View Full Code Here

                return;
            }

            OutputStream os = null;
            try {
                final XmlSerializer serializer = XmlPullParserFactory.newInstance().newSerializer();
                try {
                    serializer.setProperty("http://xmlpull.org/v1/doc/properties.html#serializer-indentation", "  ");
                } catch (Exception e) {
                    // not recognized
                }
                serializer.setOutput(os = new SafeFileOutputStream(file), myCharset.name());
                saveHistory(serializer);
            } catch (Exception ex) {
                LOG.error(ex);
            } finally {
                try {
View Full Code Here

TOP

Related Classes of org.apache.sling.rewriter.impl.components.XMLSerializerFactory$XMLSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.