private String generateMobiFile() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_hh-mm-ss");
        String mobi8FileName = String.format("KindleReader8-%s.mobi", sdf.format(new Date()));
        String mobiFileName = String.format("KindleReader-%s.mobi", sdf.format(new Date()));
        String optFilePath = this.configManager.joinPathToDataDir(processTemplateFileName(templeteFileNames[1]));
        String mobi8FilePath = this.configManager.joinPathToDataDir(mobi8FileName);

        String cmdStr = String.format("kindlegen %s -o %s ", optFilePath, mobi8FileName);

        String finalPath = mobi8FilePath;

        try {
            Process process;
            process = Runtime.getRuntime().exec(cmdStr);
            process.waitFor();

            String result = IOUtils.toString(process.getInputStream());
            logger.debug("kindlegen output info :" + result);
            logger.info("mobi file path is :" + mobi8FilePath);

            Properties rtmsConfig = this.configManager.rtmsConfig();
            if (rtmsConfig.getProperty("rtms.enableStrip").equalsIgnoreCase("true")) {
                finalPath = this.stripMobiFile(mobi8FilePath);
            }

        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return finalPath;
    }