Code examples for PrintWriter

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
63:	PrintWriter writer = new PrintWriter(dump.createFileWriter("cluster.txt")); 
-
65:	writer.println("===== CLUSTER NODES ======"); 
66:	writer.print(nodes.prettyPrint()); 
-
68:	writer.println("===== ROUTING TABLE ======"); 
69:	writer.print(routingTable.prettyPrint()); 
-
71:	writer.close(); 
Full Snippet Info
10
CodeRank
109:	PrintWriter pw = new PrintWriter(new FileOutputStream(fd)); 
110:	onDump(fd, pw, args); 
111:	pw.flush(); 
Full Snippet Info
9
CodeRank
46:	out.println("<html>"); 
47:	out.println("<head><title>LayeredTestServlet</title></head>"); 
48:	out.println("<body>Done</body>"); 
49:	out.println("</html>"); 
50:	out.close(); 
Full Snippet Info
9
CodeRank
82:	PrintWriter pw = new PrintWriter(new FileOutputStream(nodeHealthscriptFile)); 
83:	pw.println(scriptStr); 
84:	pw.flush(); 
85:	pw.close(); 
Full Snippet Info
8
CodeRank
64:	out.print(obj.getClass().getName()); 
-
66:	out.print(NOT_FOUND); 
-
68:	out.close(); 
Full Snippet Info
8
CodeRank
45:	PrintWriter pw = new PrintWriter(sw); 
46:	e.printStackTrace(pw); 
47:	pw.close(); 
Full Snippet Info
8
CodeRank
205:	PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding)); 
206:	printWriter.println(content); 
207:	printWriter.flush(); 
Full Snippet Info
8
CodeRank
28:	writer.print(stub.doIt("Test")); 
-
30:	writer.close(); 
Full Snippet Info
8
CodeRank
48:	out.println("<html>"); 
49:	out.println("<head><title>SecuredServlet</title></head>"); 
50:	out.println("<body>Done</body>"); 
51:	out.println("</html>"); 
52:	out.close(); 
Full Snippet Info
9
CodeRank
97:	pw.print(name); 
98:	pw.print("-Free: "); 
99:	pw.print(avail * bsize / 1024); 
100:	pw.print("K / "); 
101:	pw.print(total * bsize / 1024); 
102:	pw.print("K total = "); 
103:	pw.print(avail * 100 / total); 
104:	pw.println("% free"); 
-
106:	pw.print(name); 
107:	pw.print("-Error: "); 
108:	pw.println(e.toString()); 
Full Snippet Info
8
CodeRank
58:	out.println("<html>"); 
59:	out.println("<head><title>SecureServlet</title></head>"); 
60:	out.println("<h1>SecureServlet Accessed</h1>"); 
61:	out.println("<body>"); 
62:	out.println("You have accessed this servlet as user:" + user); 
-
64:	out.println("<br>The session id is: " + session.getId()); 
-
67:	out.println("</body></html>"); 
68:	out.close(); 
Full Snippet Info
9
CodeRank
69:	pw.print(prefix); pw.print("app="); pw.print(app != null ? app.toShortString() : null); 
70:	pw.print(" pid="); pw.print(pid); pw.print(" uid="); pw.print(uid); 
71:	pw.print(" user="); pw.println(userId); 
-
73:	pw.print(prefix); pw.print("curBroadcast="); pw.print(curBroadcast); 
74:	pw.print(" linkedToDeath="); pw.println(linkedToDeath); 
Full Snippet Info
7
CodeRank
84:	out.write("<h1>Quickstart: This example demonstrates the deployment of a WS-AT (WS-AtomicTransaction) enabled JAX-WS Web service bundled in a war archive for deployment to *Red Hat JBoss Enterprise Application Platform 6*.</h1>"); 
-
97:	out.write("<p><b>Transaction succeeded!</b></p>"); 
-
102:	out.write("<p><b>Transaction failed with the following error:</b></p>"); 
103:	out.write("<p><blockquote>"); 
104:	out.write(e.toString()); 
105:	out.write("</blockquote></p>"); 
-
110:	out.write("<p><i>Go to your JBoss EAP Server console or log to see the detailed result of the transaction.</i></p>"); 
Full Snippet Info
7
CodeRank
83:	PrintWriter writer = new PrintWriter(nemu+filename); 
84:	writer.println(str); 
85:	writer.flush(); 
86:	writer.close(); 
Full Snippet Info
7
CodeRank
90:	PrintWriter writer = new PrintWriter(jettyHttpExchange.getResponseBody()); 
-
93:	writer.println("<h2>HTTP ERROR: 500</h2>"); 
94:	writer.println("<pre>INTERNAL_SERVER_ERROR</pre>"); 
95:	writer.println("<p>RequestURI=" + req.getRequestURI() + "</p>"); 
-
97:	writer.println("<pre>"); 
-
99:	writer.println("</pre>"); 
Full Snippet Info
7
CodeRank
157:	PrintWriter debugWriter = new PrintWriter(new CommonsLogWriter(this.debugLogger)); 
-
159:	HessianDebugInputStream dis = new HessianDebugInputStream(inputStream, debugWriter); 
-
161:	HessianDebugOutputStream dos = new HessianDebugOutputStream(outputStream, debugWriter); 
Full Snippet Info
7
CodeRank
24:	writerOut = new PrintWriter( 
-
26:	Printer.v().printTo(cls, writerOut); 
-
28:	writerOut.flush(); 
Full Snippet Info
7
CodeRank
75:	out.println("<html>"); 
76:	out.println("<head><title>EJBServlet</title></head>"); 
77:	out.println("<body>Tests passed<br>Time:" + new Date().toString() + "</body>"); 
78:	out.println("</html>"); 
79:	out.close(); 
Full Snippet Info
9
CodeRank
53:	PrintWriter capture = new PrintWriter(sw); 
54:	record.getThrown().printStackTrace(capture); 
55:	capture.flush(); 
-
57:	IO.close(capture); 
Full Snippet Info
7
CodeRank
75:	writer.println(); 
76:	writer.print(prefix); 
77:	writer.print(INDENT); 
78:	writer.print(INDENT); 
Full Snippet Info
7
CodeRank