Package nl.siegmann.epublib.bookprocessor

Examples of nl.siegmann.epublib.bookprocessor.DefaultBookProcessorPipeline


      }
    }
    if(StringUtils.isBlank(inputLocation) || StringUtils.isBlank(outLocation)) {
      usage();
    }
    BookProcessorPipeline epubCleaner = new DefaultBookProcessorPipeline();
    epubCleaner.addBookProcessors(createBookProcessors(bookProcessorClassNames));
    EpubWriter epubWriter = new EpubWriter(epubCleaner);
    if(! StringUtils.isBlank(xslFile)) {
      epubCleaner.addBookProcessor(new XslBookProcessor(xslFile));
    }
   
    if (StringUtils.isBlank(inputEncoding)) {
      inputEncoding = Constants.CHARACTER_ENCODING;
    }
   
    Book book;
    if("chm".equals(type)) {
      book = ChmParser.parseChm(VFSUtil.resolveFileObject(inputLocation), inputEncoding);
    } else if ("epub".equals(type)) {
      book = new EpubReader().readEpub(VFSUtil.resolveInputStream(inputLocation), inputEncoding);
    } else {
      book = FilesetBookCreator.createBookFromDirectory(VFSUtil.resolveFileObject(inputLocation), inputEncoding);
    }
   
    if(StringUtils.isNotBlank(coverImage)) {
//      book.getResourceByHref(book.getCoverImage());
      book.setCoverImage(new Resource(VFSUtil.resolveInputStream(coverImage), coverImage));
      epubCleaner.getBookProcessors().add(new CoverpageBookProcessor());
    }
   
    if(StringUtils.isNotBlank(title)) {
      List<String> titles = new ArrayList<String>();
      titles.add(title);
View Full Code Here

TOP

Related Classes of nl.siegmann.epublib.bookprocessor.DefaultBookProcessorPipeline

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.