List of usage examples for java.lang System lineSeparator
String lineSeparator
To view the source code for java.lang System lineSeparator.
Click Source Link
From source file:io.pivotalservices.wiretaprouteservice.CatchAllController.java
private static void printHeaders(String type, HttpHeaders headers) { StringBuilder sb = new StringBuilder(type + " HEADER "); sb.append(System.lineSeparator()); for (String key : headers.keySet()) { List<String> values = headers.getValuesAsList(key); sb.append("KEY: " + key + " VALUES: "); for (String value : values) { sb.append(value + "; "); }/*from w w w.jav a 2 s .c o m*/ sb.append(System.lineSeparator()); } logger.debug(sb.toString()); }
From source file:com.wormsim.data.GroupDistribution.java
@Override public String toString() { StringBuilder b = new StringBuilder(); dists.entrySet().forEach((dist) -> { b.append("\t").append(dist.getKey().toString()).append(" ~ ") .append(Utils.integerDistributionToString(dist.getValue())).append(System.lineSeparator()); });// ww w . ja v a2 s .c o m return b.toString(); }
From source file:com.github.rinde.gpem17.evo.StatsLogger.java
static void createHeader(File dest) { try {/* w w w. ja va 2 s .c o m*/ Files.createParentDirs(dest); Files.append( Joiner.on(",").appendTo(new StringBuilder(), CsvFields.values()).append(System.lineSeparator()), dest, Charsets.UTF_8); } catch (final IOException e1) { throw new IllegalStateException(e1); } }
From source file:middleware.LogTailerListener.java
public void handle(String line, long offset) { // if it is resumed then no need to send dstat headers. if (resumed) { if (line.contains("Dstat") || line.contains("Author") || line.contains("Host") || line.contains("Cmdline") || line.contains("epoch") || line.isEmpty()) { return; }//from w w w . j av a2 s. co m } IncrementalLog log = new IncrementalLog(type, (line + System.lineSeparator()).getBytes(), offset); while (!queue.offer(log)) { try { Thread.sleep(100); } catch (InterruptedException e) { if (this.run) { e.printStackTrace(); } } if (!this.run) break; } this.offset = offset; }
From source file:com.bc.fiduceo.ingest.IngestionToolTest.java
@Before public void SetUp() { ls = System.lineSeparator(); ingestionTool = new IngestionTool(); }
From source file:mesosphere.dcos.hazelcast.discovery.DcosDiscoveryStrategy.java
@Override public Iterable<DiscoveryNode> discoverNodes() { List<DiscoveryNode> servers = new LinkedList<>(); for (String node : StringUtils.split(System.getenv("HAZELCAST_INITIAL_MEMBERS"), System.lineSeparator())) { try {/*from w ww .ja va2 s . com*/ servers.add(new SimpleDiscoveryNode(new Address(node, 5701))); } catch (UnknownHostException e) { LOG.warn(String.format("DNS name '%s' not resolvable", node), e); } } return servers; }
From source file:com.glluch.profilesparser.Writer.java
/** * For each profile, writes an xml file for add to Solr. TODO Make the read dir a var. * @param path The directory where the files will be written. * @throws IOException if can't read o write *///w w w . j a v a2s . co m public void profiles2SolrXML(String path) throws IOException { ProfileHtmlReader phr = new ProfileHtmlReader(); ArrayList<ICTProfile> ps = phr.readerDir("resources/ict_profiles"); for (ICTProfile pp : ps) { HashMap<String, Double> ieee = Profile2IEEE.fillTerms(pp); String xml = "<add><doc>" + System.lineSeparator(); xml += "<field name=\"id\""; xml += ">" + System.lineSeparator(); xml += pp.getTitle(); xml += "</field>" + System.lineSeparator(); xml += "<field name=\"type\">ICT_profile</field>" + System.lineSeparator(); xml += terms2xml("term", ieee); xml += competences2xml(pp.getEcfs()); xml += "</doc></add>"; //competencesXMLsolr String fileTitle = pp.getTitle() + ".xml"; FileUtils.writeStringToFile(new File(path + fileTitle), xml, "utf8"); } }
From source file:io.jjcastillo.bconferencia.helper.Storage.java
public void load() { File f = new File(FILE_NAME); if (f.exists()) { //load data BufferedReader br = null; try {//from w ww . j av a 2 s. co m br = new BufferedReader(new FileReader(FILE_NAME)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append(System.lineSeparator()); line = br.readLine(); } String dataString = sb.toString(); ArrayList<Auditorio> data = new ArrayList(); data = fromJSON(dataString); if (data != null && data.size() > 1) { auditorio1 = data.get(0); auditorio2 = data.get(1); } else { System.out.println("no se pudo recuperar datos"); } } catch (IOException ex) { Logger.getLogger(Storage.class.getName()).log(Level.SEVERE, null, ex); } finally { if (br != null) { try { br.close(); } catch (IOException ex) { Logger.getLogger(Storage.class.getName()).log(Level.SEVERE, null, ex); } } } } else { try { //primera vez, create data f.createNewFile(); saveAll(); } catch (IOException ex) { Logger.getLogger(Storage.class.getName()).log(Level.SEVERE, null, ex); } } }
From source file:de.micromata.genome.util.strings.ReducedMultiLineStyle.java
@Override protected void appendFieldSeparator(StringBuffer buffer) { buffer.append(System.lineSeparator()); int level = ReducedReflectionToStringBuilder.getRegistryObject().level; for (int i = 0; i <= level; ++i) { buffer.append(" "); }/*from ww w . j a va 2 s .c o m*/ }