}
}
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);