private void writeContentToFile(String content, String templateFileName) {
        if (content == null) {
            throw new NullPointerException("the arg:sw can not be null");
        }

        String fileName = processTemplateFileName(templateFileName);
        String fileFullPath = this.configManager.joinPathToDataDir(fileName);

        try {
            File newFile = new File(fileFullPath);
            if (!newFile.exists()) {
                boolean isSuccess = newFile.createNewFile();
                if (!isSuccess) {
                    throw new RuntimeException("create new file failed at path:" + fileFullPath);
                }
            }

            FileOutputStream is = new FileOutputStream(newFile);
            is.write(content.getBytes());
            is.close();

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