List of usage examples for java.io PrintStream println
public void println(Object x)
From source file:com.globalsight.ling.tm3.tools.CreateMultilingualTmCommand.java
@Override protected void printExtraHelp(PrintStream out) { out.println("Creates a new multilingual TM with dedicated storage."); }
From source file:com.globalsight.ling.tm3.tools.CreateSharedTmCommand.java
@Override protected void printExtraHelp(PrintStream out) { out.println("Creates a new multilingual TM using a shared storage pool."); }
From source file:com.globalsight.ling.tm3.tools.AddAttributeCommand.java
@Override protected void printExtraHelp(PrintStream out) { out.println("Adds one or more attributes to a given TM"); }
From source file:edu.northwestern.bioinformatics.studycalendar.dataproviders.commands.BusyBoxCommand.java
private void reportMissingArgument(String subcommandName, PrintStream err) { err.println(String.format("Please specify an argument for %s", subcommandName)); }
From source file:edu.northwestern.bioinformatics.studycalendar.dataproviders.commands.BusyBoxCommand.java
private void reportInvalidSubcommand(PrintStream err) { err.println(String.format("Please specify a valid subcommand (%s)", StringUtils.join(subcommands.keySet().iterator(), ", "))); }
From source file:com.globalsight.ling.tm3.tools.DeleteAttributeCommand.java
@Override protected void printExtraHelp(PrintStream out) { out.println("Deletes one or more attributes from a given TM"); }
From source file:com.knowbout.epg.EPG.java
private static void updateSitemap(String sitemap) { int lastslash = sitemap.lastIndexOf('/'); String inprogress = sitemap.substring(0, lastslash) + "/inprogress-" + sitemap.substring(lastslash + 1); String marker = "<!-- EVERYTHING BELOW IS AUTOMATICALLY GENERATED -->"; String baseurl = null;//w w w . j a v a 2 s .co m try { PrintStream doc = new PrintStream(new GZIPOutputStream(new FileOutputStream(inprogress))); BufferedReader orig = new BufferedReader( new InputStreamReader(new GZIPInputStream(new FileInputStream(sitemap)))); String line = orig.readLine(); while (line != null) { if ((line.indexOf("</urlset>") >= 0) || (line.indexOf(marker) >= 0)) { break; } if (baseurl == null) { if (line.indexOf("<loc>") >= 0) { int http = line.indexOf("http://"); int nextslash = line.indexOf("/", http + 7); baseurl = line.substring(http, nextslash); } } doc.println(line); line = orig.readLine(); } doc.println(marker); Set<String> teams = new HashSet<String>(); HibernateUtil.openSession(); try { ScrollableResults scroll = Program.selectAllTeams(); while (scroll.next()) { Program program = (Program) scroll.get(0); addToSitemap(doc, baseurl, program); teams.add(program.getSportName() + ":" + program.getTeamName()); } scroll = Program.selectAllShowsMoviesSports(); while (scroll.next()) { Program program = (Program) scroll.get(0); if (program.isSports()) { if (!teams.contains(program.getSportName() + ":" + program.getHomeTeamName())) { Program home = Program.selectByTeam(program.getSportName(), program.getHomeTeamName()); addToSitemap(doc, baseurl, home); teams.add(home.getSportName() + ":" + home.getTeamName()); } if (!teams.contains(program.getSportName() + ":" + program.getAwayTeamName())) { Program away = Program.selectByTeam(program.getSportName(), program.getAwayTeamName()); addToSitemap(doc, baseurl, away); teams.add(away.getSportName() + ":" + away.getTeamName()); } } else { addToSitemap(doc, baseurl, program); } } } finally { HibernateUtil.closeSession(); } doc.println("</urlset>"); doc.close(); orig.close(); File origFile = new File(sitemap); File backupFile = new File(sitemap + ".bak"); File inprogressFile = new File(inprogress); backupFile.delete(); if (!origFile.renameTo(backupFile)) { throw new IOException("Could not rename " + origFile + " to " + backupFile); } if (!inprogressFile.renameTo(origFile)) { throw new IOException("Could not rename " + inprogressFile + " to " + origFile); } } catch (FileNotFoundException e) { log.error("Could not write to " + inprogress, e); } catch (IOException e) { log.error("IO Exception for " + inprogress + " or " + sitemap, e); } }
From source file:com.tesora.dve.tools.CLIBuilder.java
public static void printInColor(final String message, final ConsoleColor color, final PrintStream outputStream) { if (outputStream == null) { throw new IllegalArgumentException("No output stream specified"); }//from ww w. j a v a 2s .c o m outputStream.println(getInColor(message, color)); }
From source file:com.globalsight.ling.tm3.tools.CreateBilingualTmCommand.java
@Override protected void printExtraHelp(PrintStream out) { out.println("Creates a new bilingual TM with the given source and target locale."); out.println("Locales should be specified as xx_YY codes."); }
From source file:kenh.xscript.ScriptUtils.java
/** * Debug method for <code>Element</code> * @param element/*from w w w . j a v a 2 s. c o m*/ * @param level * @param stream */ private static final void debug_(Element element, int level, PrintStream stream) { String repeatStr = " "; String prefix = StringUtils.repeat(repeatStr, level); stream.print(prefix + "<" + element.getClass().getCanonicalName()); // Attribute output Map<String, String> attributes = element.getAttributes(); if (attributes != null && attributes.size() > 0) { Set<String> keys = attributes.keySet(); for (String key : keys) { stream.print(" " + key + "=\"" + attributes.get(key) + "\""); } } Vector<Element> children = element.getChildren(); String text = element.getText(); if ((children == null || children.size() == 0) && StringUtils.isBlank(text)) { stream.println("/>"); return; } else { stream.println(">"); // child elements if (children != null && children.size() > 0) { for (Element child : children) { debug_(child, level + 1, stream); } } // text/context if (StringUtils.isNotBlank(text)) { stream.println(prefix + repeatStr + "<![CDATA[" + text + "]]>"); } stream.println(prefix + "</" + element.getClass().getCanonicalName() + ">"); } }