List of usage examples for java.io PrintStream println
public void println(Object x)
From source file:com.globalsight.ling.tm3.integration.MigrateTmCommand.java
@Override protected void printExtraHelp(PrintStream out) { out.println("Migrate a legacy (tm2) Project TM to tm3. This will create"); out.println("a new Project TM to store the migrated data and leave the"); out.println("original TM intact. Note that tm3 must be enabled for the"); out.println("company in order for this operation to succeed."); out.println("Migrating a TM more than once will produce multiple copies"); out.println("Of the migrated TM."); }
From source file:J2MEFileConnection.java
public void commandAction(Command command, Displayable displayable) { if (command == exit) { destroyApp(false);//from w w w .java 2s . c om notifyDestroyed(); } else if (command == start) { try { OutputConnection connection = (OutputConnection) Connector.open("file://c:/myfile.txt;append=true", Connector.WRITE); OutputStream out = connection.openOutputStream(); PrintStream output = new PrintStream(out); output.println("This is a test."); out.close(); connection.close(); Alert alert = new Alert("Completed", "Data Written", null, null); alert.setTimeout(Alert.FOREVER); alert.setType(AlertType.ERROR); display.setCurrent(alert); } catch (Exception error) { Alert alert = new Alert("Error", error.toString(), null, null); alert.setTimeout(Alert.FOREVER); alert.setType(AlertType.ERROR); display.setCurrent(alert); } } }
From source file:com.ebay.logstorm.server.utils.EagleBanner.java
@Override public void printBanner(Environment environment, Class<?> sourceClass, PrintStream printStream) { for (String line : BANNER) { printStream.println(line); }//w w w. j a v a 2s . c o m String version = SpringBootVersion.getVersion(); version = (version == null ? "" : " (v" + version + ")"); String padding = ""; while (padding.length() < STRAP_LINE_SIZE - (version.length() + SPRING_BOOT.length())) { padding += " "; } printStream.println(AnsiOutput.toString(AnsiColor.GREEN, SPRING_BOOT, AnsiColor.DEFAULT, padding, AnsiStyle.FAINT, version)); printStream.println(); }
From source file:com.ibm.devops.dra.AbstractDevOpsAction.java
/** * locate triggered build/*from w ww . jav a2 s . c o m*/ * @param build - the current running build of this job * @param name - the build job name that you are going to locate * @param printStream - logger * @return */ public static Run<?, ?> getTriggeredBuild(Run build, String name, EnvVars envVars, PrintStream printStream) { // if user specify the build job as current job or leave it empty if (name == null || name.isEmpty() || name.equals(build.getParent().getName())) { printStream.println("[IBM Cloud DevOps] Current job is the build job"); return build; } else { name = envVars.expand(name); Job<?, ?> job = Jenkins.getInstance().getItem(name, getItemGroup(build), Job.class); if (job != null) { Run src = getBuild(job, build); if (src == null) { // if user runs the test job independently printStream.println( "[IBM Cloud DevOps] Are you running the test job independently? Use the last successful build of the build job"); src = job.getLastSuccessfulBuild(); } return src; } else { // if user does not specify the build job or can not find the build job that user specifies printStream.println( "[IBM Cloud DevOps] ERROR: Failed to find the build job, please check the build job name"); return null; } } }
From source file:com.hp.application.automation.tools.run.SvDeployBuilder.java
private void printProjectContent(IProject project, PrintStream logger) { logger.println(" Project content:"); for (IService service : project.getServices()) { logger.println(" Service: " + service.getName() + " [" + service.getId() + "]"); for (IDataModel dataModel : service.getDataModels()) { logger.println(" DM: " + dataModel.getName() + " [" + dataModel.getId() + "]"); }/*from w ww .j a v a 2 s . co m*/ for (IPerfModel perfModel : service.getPerfModels()) { logger.println(" PM: " + perfModel.getName() + " [" + perfModel.getId() + "]"); } } }
From source file:de.tudarmstadt.ukp.clarin.webanno.brat.curation.AgreementUtils.java
public static void dumpStudy(PrintStream aOut, ICodingAnnotationStudy aStudy) { try {//from ww w . j a va2 s.c o m aOut.printf("Category count: %d%n", aStudy.getCategoryCount()); } catch (Throwable e) { aOut.printf("Category count: %s%n", ExceptionUtils.getRootCauseMessage(e)); } try { aOut.printf("Item count: %d%n", aStudy.getItemCount()); } catch (Throwable e) { aOut.printf("Item count: %s%n", ExceptionUtils.getRootCauseMessage(e)); } for (ICodingAnnotationItem item : aStudy.getItems()) { StringBuilder sb = new StringBuilder(); for (IAnnotationUnit unit : item.getUnits()) { if (sb.length() > 0) { sb.append(" \t"); } sb.append(unit.getCategory()); } aOut.println(sb); } }
From source file:com.googlecode.android_scripting.jsonrpc.JsonRpcServerTest.java
public void testValidHandshake() throws IOException, JSONException { JsonRpcServer server = new JsonRpcServer(null, "foo"); InetSocketAddress address = server.startLocal(0); Socket client = new Socket(); client.connect(address);//from www . j a v a 2 s . c o m PrintStream out = new PrintStream(client.getOutputStream()); out.println(buildRequest(0, "_authenticate", Lists.newArrayList("foo"))); BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); JSONObject response = new JSONObject(in.readLine()); Object error = response.get("error"); assertEquals(JSONObject.NULL, error); client.close(); server.shutdown(); }
From source file:com.anrisoftware.mongoose.buildins.echobuildin.EchoBuildin.java
private OutputWorker createOutputNewLine() { return new OutputWorker() { @Override// w ww .j a va2 s . c om public void output(PrintStream output, String text) { output.println(text); } }; }
From source file:com.mockey.ui.StickyCookieSessionAjaxServlet.java
/** * //from w w w .j av a2 s .co m */ public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { JSONObject jsonObject = new JSONObject(); try { ClientExecuteProxy.resetStickySession(); jsonObject.put("reset", true); } catch (Exception e) { try { jsonObject.put("error", "Unable to reset sticky session"); } catch (JSONException e1) { logger.error("Unable to create JSON", e1); } } resp.setContentType("application/json"); PrintStream out = new PrintStream(resp.getOutputStream()); out.println(jsonObject.toString()); }
From source file:com.xpn.xwiki.store.XWikiBatcherStats.java
public void printSQLList(PrintStream out) { out.println("SQL: number of queries " + sqlList.size()); for (int i = 0; i < sqlList.size(); i++) { out.println("SQL: " + sqlList.get(i)); }/*from w ww. j av a 2 s.co m*/ out.flush(); }