String cmdline = MessageFormat.format("{0} {1} {2} {3}", (Object[]) cmd); LOG.info(cmdline);
LOG.info(StringUtils.join(cmd, ' '));
    public void generateProfiles() {        String outputfile = getPhoneFilename();        String outputTxtfile = outputfile + ".txt";        FileWriter wtr = null;        packBitmaps();        try {            wtr = new FileWriter(outputTxtfile);            generateProfile(wtr);        } catch (IOException e) {            throw new RuntimeException(e);        } finally {            IOUtils.closeQuietly(wtr);        }        requireFile(getCfgfmtUtility());        requireFile(getPtagDat());        try {            String[] cmd = {                getCfgfmtUtility(), "-t" + getPtagDat(), outputTxtfile, outputfile            };            String cmdline = MessageFormat.format("{0} {1} {2} {3}", (Object[]) cmd);            LOG.info(cmdline);            Process p = Runtime.getRuntime().exec(cmd);            int errCode = p.waitFor();            if (errCode != 0) {                String msg = "Cisco profile conversion utility failed status code:" + errCode;                StringWriter err = new StringWriter();                err.write(msg.toCharArray());                IOUtils.copy(p.getErrorStream(), err);                throw new RuntimeException(err.toString());            }        } catch (IOException e) {            throw new RuntimeException(e);        } catch (InterruptedException e) {            throw new RuntimeException(e);        }        if (!m_isTextFormatEnabled) {            try {                FileUtils.forceDelete(new File(outputTxtfile));            } catch (IOException e) {                // ignore delete failure                LOG.info(e.getMessage());            }        }    }