Example usage for org.apache.commons.io IOUtils LINE_SEPARATOR

List of usage examples for org.apache.commons.io IOUtils LINE_SEPARATOR

Introduction

In this page you can find the example usage for org.apache.commons.io IOUtils LINE_SEPARATOR.

Prototype

String LINE_SEPARATOR

To view the source code for org.apache.commons.io IOUtils LINE_SEPARATOR.

Click Source Link

Document

The system line separator string.

Usage

From source file:org.sonar.oracleforms.plsql.decorators.GuiItemDecorator.java

public String decorate(Node node, String text) {
    if (!node.isGuiItem() || StringUtils.isBlank(text) || node.isAlias()) {
        return text;
    }//from   www .  j  a v  a 2s  .c  o m

    return new StringBuilder().append("Declare").append(IOUtils.LINE_SEPARATOR).append("Procedure ")
            .append(node.getPlsqlName()).append("_").append(" Is").append(IOUtils.LINE_SEPARATOR)
            .append("Begin").append(IOUtils.LINE_SEPARATOR).append(text).append(IOUtils.LINE_SEPARATOR)
            .append("End ").append(node.getPlsqlName()).append("_").append(";").append(IOUtils.LINE_SEPARATOR)
            .append("Begin").append(IOUtils.LINE_SEPARATOR).append(node.getPlsqlName()).append("_").append(";")
            .append(IOUtils.LINE_SEPARATOR).append("End;").append(IOUtils.LINE_SEPARATOR).toString();
}

From source file:org.sonar.plugins.fxcop.FxCopRulesetWriter.java

private static void appendLine(StringBuilder sb, String s) {
    sb.append(s);
    sb.append(IOUtils.LINE_SEPARATOR);
}

From source file:org.sonar.plugins.spcaf.SpcafSettingsWriter.java

private static void appendLine(Writer writer, String s) throws IOException {
    writer.write(s);
    writer.write(IOUtils.LINE_SEPARATOR);
}

From source file:se.trixon.toolbox.idiot.task.Task.java

private synchronized void logToFile(String message) {
    File dir = new File(mDestination).getParentFile();
    String basename = FilenameUtils.getBaseName(mDestination);
    String ext = FilenameUtils.getExtension(mDestination);
    if (ext.equalsIgnoreCase("log")) {
        ext = "log.log";
    } else {/*from   www.  ja va 2s .c o m*/
        ext = "log";
    }

    File logFile = new File(dir, String.format("%s.%s", basename, ext));
    String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH.mm.ss").format(new Date(System.currentTimeMillis()));

    message = String.format("%s %s%s", timeStamp, message, IOUtils.LINE_SEPARATOR);

    try {
        FileUtils.writeStringToFile(logFile, message, true);
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }
}