java.io.PrintWriter#println ( )源码实例Demo

下面列出了java.io.PrintWriter#println ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: workspacemechanic   文件: EpfFileModelWriter.java
public static void write(EpfFileModel model, OutputStream outputStream) throws IOException {
  PrintWriter commentPrintWriter = new PrintWriter(outputStream);
  commentPrintWriter.format("# @title %s\n", model.getTitle());
  commentPrintWriter.format("# @description %s\n", model.getDescription());
  commentPrintWriter.format("# @task_type %s\n#\n", model.getTaskType().toString());
  commentPrintWriter.println(
      "# Created by the Workspace Mechanic Preference Recorder");
  commentPrintWriter.flush();

  // Use java Properties object to output key/value pairs
  
  Properties outputProperties = new Properties();
  
  outputProperties.setProperty("file_export_version", "3.0");
  
  for (Map.Entry<String, String> e : model.getPreferences().entrySet()) {
    String value = e.getValue();
    if(value == null) {
      value = "";
    }
    outputProperties.setProperty(e.getKey(), value);
  }

  outputProperties.store(outputStream, null);
}
 
源代码2 项目: android_9.0.0_r45   文件: PersistentConnection.java
public void dump(String prefix, PrintWriter pw) {
    synchronized (mLock) {
        pw.print(prefix);
        pw.print(mComponentName.flattenToShortString());
        pw.print(mBound ? "  [bound]" : "  [not bound]");
        pw.print(mIsConnected ? "  [connected]" : "  [not connected]");
        if (mRebindScheduled) {
            pw.print("  reconnect in ");
            TimeUtils.formatDuration((mReconnectTime - injectUptimeMillis()), pw);
        }
        pw.println();

        pw.print(prefix);
        pw.print("  Next backoff(sec): ");
        pw.print(mNextBackoffMs / 1000);
    }
}
 
/**
 * 所有请求都会经过的方法。
 */
@Override
protected boolean onAccessDenied(ServletRequest request,
		ServletResponse response) throws Exception {

	if (isLoginRequest(request, response)) {
		if (isLoginSubmission(request, response)) {

			if (log.isTraceEnabled()) {
				log.trace("Login submission detected.  Attempting to execute login.");
			}

			return executeLogin(request, response);
		} else {
			if (log.isTraceEnabled()) {
				log.trace("Login page view.");
			}
			// allow them to see the login page ;)
			return true;
		}
	} else {

		if (log.isTraceEnabled()) {
			log.trace("Attempting to access a path which requires authentication.  Forwarding to the "
					+ "Authentication url [" + getLoginUrl() + "]");
		}
		if (!"XMLHttpRequest"
				.equalsIgnoreCase(((HttpServletRequest) request)
						.getHeader("X-Requested-With"))) {// 不是ajax请求
			saveRequestAndRedirectToLogin(request, response);
		} else {
			response.setCharacterEncoding("UTF-8");
			PrintWriter out = response.getWriter();
			out.println("{message:'login'}");
			out.flush();
			out.close();
		}
		return false;
	}
}
 
源代码4 项目: openjdk-jdk8u-backup   文件: Driver.java
protected File writeTestFile(String fullFile) throws IOException {
    File f = new File("Test.java");
    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
    out.println(fullFile);
    out.close();
    return f;
}
 
源代码5 项目: lams   文件: QuerySpaceTreePrinter.java
private void writeJoins(
		Iterable<Join> joins,
		int depth,
		AliasResolutionContext aliasResolutionContext,
		PrintWriter printWriter) {
	for ( Join join : joins ) {
		printWriter.println(
				TreePrinterHelper.INSTANCE.generateNodePrefix( depth ) + extractDetails( join )
		);
		writeQuerySpace( join.getRightHandSide(), depth+1, aliasResolutionContext, printWriter );
	}
}
 
源代码6 项目: hbase-tools   文件: ExportKeys.java
private boolean export(PrintWriter writer, HRegionInfo regionInfo) throws DecoderException {
    String tableName = CommandAdapter.getTableName(regionInfo);
    String startKeyHexStr = Bytes.toStringBinary(regionInfo.getStartKey());
    String endKeyHexStr = Bytes.toStringBinary(regionInfo.getEndKey());

    if (startKeyHexStr.length() > 0 || endKeyHexStr.length() > 0) {
        writer.println(tableName + DELIMITER + " " + startKeyHexStr + DELIMITER + " " + endKeyHexStr);
        return true;
    } else {
        return false;
    }
}
 
源代码7 项目: big-c   文件: DatanodeManager.java
/** Prints information about all datanodes. */
void datanodeDump(final PrintWriter out) {
  synchronized (datanodeMap) {
    out.println("Metasave: Number of datanodes: " + datanodeMap.size());
    for(Iterator<DatanodeDescriptor> it = datanodeMap.values().iterator(); it.hasNext();) {
      DatanodeDescriptor node = it.next();
      out.println(node.dumpDatanode());
    }
  }
}
 
源代码8 项目: development   文件: BssClient.java
/**
 * This method prints the web service client properties
 * 
 * @param out
 *            response writer object
 */
private static void getWebServiceClientProperties(PrintWriter out) {
    out.println("Web service client properties:</br></br>");
    out.println("Endpoint Address: "
            + wsProxyInfo.getWsInfo().getEndpointAddress() + "</br>");
    out.println("Client service version: "
            + wsProxyInfo.getServiceVersion() + "</br>");
    out.println("User: " + wsProxyInfo.getUserCredentials().getUser()
            + "</br>");
    out.println("Password: ****</br>");
    out.println("Tenant ID: ****</br></br></br>");
}
 
源代码9 项目: owltools   文件: OntologyReportGenerator.java
protected void writeTabs(PrintWriter writer, CharSequence... fields) {
	for (int i = 0; i < fields.length; i++) {
		if (i > 0) {
			writer.print('\t');
		}
		writer.print(fields[i]);

	}
	writer.println();
}
 
源代码10 项目: TencentKona-8   文件: InternalRunnable.java
@Override
public String toString() {
    final StringWriter sw = new StringWriter();
    final PrintWriter pw = new PrintWriter(sw);
    if(runExecuted) {
        pw.println("InternalRunnable.run() executed!");
    }
    pw.println("InternalRunnable.toString() executed!");
    pw.flush();
    return sw.toString();
}
 
源代码11 项目: openjdk-8   文件: ValueBoxGen.java
public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream)
{
  ValueEntry vt = (ValueEntry) entry;
  TypedefEntry member = (TypedefEntry) ((InterfaceState) (vt.state ()).elementAt (0)).entry;
  SymtabEntry mType = Util.typeOf (member);
  index = ((JavaGenerator)mType.generator ()).type (index, indent, tcoffsets, name, mType, stream);
  stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_value_box_tc ("
    + "_id, "
    + '"' + entry.name () + "\", "
    + name
    + ");");
  return index;
}
 
private boolean printError(int errCode, String pkgName, int userId, int jobId) {
    PrintWriter pw;
    switch (errCode) {
        case CMD_ERR_NO_PACKAGE:
            pw = getErrPrintWriter();
            pw.print("Package not found: ");
            pw.print(pkgName);
            pw.print(" / user ");
            pw.println(userId);
            return true;

        case CMD_ERR_NO_JOB:
            pw = getErrPrintWriter();
            pw.print("Could not find job ");
            pw.print(jobId);
            pw.print(" in package ");
            pw.print(pkgName);
            pw.print(" / user ");
            pw.println(userId);
            return true;

        case CMD_ERR_CONSTRAINTS:
            pw = getErrPrintWriter();
            pw.print("Job ");
            pw.print(jobId);
            pw.print(" in package ");
            pw.print(pkgName);
            pw.print(" / user ");
            pw.print(userId);
            pw.println(" has functional constraints but --force not specified");
            return true;

        default:
            return false;
    }
}
 
源代码13 项目: hottub   文件: DocLint.java
public void run(PrintWriter out, String... args) throws BadArgs, IOException {
    env = new Env();
    processArgs(args);

    if (needHelp)
        showHelp(out);

    if (javacFiles.isEmpty()) {
        if (!needHelp)
            out.println(localize("dc.main.no.files.given"));
    }

    JavacTool tool = JavacTool.create();

    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    fm.setSymbolFileEnabled(false);
    fm.setLocation(StandardLocation.PLATFORM_CLASS_PATH, javacBootClassPath);
    fm.setLocation(StandardLocation.CLASS_PATH, javacClassPath);
    fm.setLocation(StandardLocation.SOURCE_PATH, javacSourcePath);

    JavacTask task = tool.getTask(out, fm, null, javacOpts, null,
            fm.getJavaFileObjectsFromFiles(javacFiles));
    Iterable<? extends CompilationUnitTree> units = task.parse();
    ((JavacTaskImpl) task).enter();

    env.init(task);
    checker = new Checker(env);

    DeclScanner ds = new DeclScanner() {
        @Override
        void visitDecl(Tree tree, Name name) {
            TreePath p = getCurrentPath();
            DocCommentTree dc = env.trees.getDocCommentTree(p);

            checker.scan(dc, p);
        }
    };

    ds.scan(units, null);

    reportStats(out);

    Context ctx = ((JavacTaskImpl) task).getContext();
    JavaCompiler c = JavaCompiler.instance(ctx);
    c.printCount("error", c.errorCount());
    c.printCount("warn", c.warningCount());
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: ValueGen.java
public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream)
{
// <d59418 - KLR> per Simon, make "static" read call istream.read_value.
//                put real marshalling code in read_value.

  if (((ValueEntry)entry).isAbstract ())
  {
    stream.println ("    throw new org.omg.CORBA.BAD_OPERATION (\"abstract value cannot be instantiated\");");
  }
  else
  {
  stream.println ("    return (" + entryName +") ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (get_instance());"); // <d60929>
  }
  stream.println ("  }");
  stream.println ();

  // done with "read", now do "read_value with real marshalling code.

  stream.println ("  public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream)"); // <d60929>
  stream.println ("  {");

  // per Simon, 3/3/99, read_value for custom values throws an exception
  if (((ValueEntry)entry).isAbstract ())
  {
    stream.println ("    throw new org.omg.CORBA.BAD_OPERATION (\"abstract value cannot be instantiated\");");
  }
  else
    if (((ValueEntry)entry).isCustom ())
    {
      stream.println ("    throw new org.omg.CORBA.BAD_OPERATION (\"custom values should use unmarshal()\");");
    }
    else
    {
      stream.println ("    " + entryName + " value = new " + entryName + " ();");
      read (0, "    ", "value", entry, stream);
      stream.println ("    return value;");
    }
  stream.println ("  }");
  stream.println ();
  // End of normal read method

  // Per Simon, 8/26/98 - Value helpers get an additional overloaded
  // read method where the value is passed in instead of "new'd" up. This is
  // used for reading parent value state.

  // Per Simon, 3/3/99 - Don't change this "read" for custom marshalling
  stream.println ("  public static void read (org.omg.CORBA.portable.InputStream istream, " + entryName + " value)");
  stream.println ("  {");
  read (0, "    ", "value", entry, stream);
}
 
源代码15 项目: openjdk-8   文件: UnionGen.java
private int readNonBoolean (String disName, int index, String indent,
    String name, UnionEntry u, PrintWriter stream)
{
    SymtabEntry utype = Util.typeOf (u.type ());

    if (utype instanceof EnumEntry)
        stream.println (indent + "switch (" + disName + ".value ())");
    else
        stream.println (indent + "switch (" + disName + ')');

    stream.println (indent + '{');
    String typePackage = Util.javaQualifiedName (utype) + '.';

    Enumeration e = u.branches ().elements ();
    while (e.hasMoreElements ()) {
        UnionBranch branch = (UnionBranch)e.nextElement ();
        Enumeration labels = branch.labels.elements ();

        while (labels.hasMoreElements ()) {
            Expression label = (Expression)labels.nextElement ();

            if (utype instanceof EnumEntry) {
                String key = Util.parseExpression (label);
                stream.println (indent + "  case " + typePackage + '_' + key + ':');
            } else
                stream.println (indent + "  case " + cast (label, utype) + ':');
        }

        if (!branch.typedef.equals (u.defaultBranch ())) {
            index = readBranch (index, indent + "    ", branch.typedef.name (),
                branch.labels.size() > 1 ? disName : "" ,
                branch.typedef, stream);
            stream.println (indent + "    break;");
        }
    }

    // We need a default branch unless all of the case of the discriminator type
    // are listed in the case branches.
    if (!coversAll(u)) {
        stream.println( indent + "  default:") ;

        if (u.defaultBranch () == null) {
            // If the union does not have a default branch, we still need to initialize
            // the discriminator.
            stream.println( indent + "    value._default( " + disName + " ) ;" ) ;
        } else {
            index = readBranch (index, indent + "    ", u.defaultBranch ().name (), disName,
                u.defaultBranch (), stream);
        }

        stream.println (indent + "    break;");
    }

    stream.println (indent + '}');

    return index;
}
 
源代码16 项目: RDFS   文件: TestFairScheduler.java
public void testAllocationFileParsing() throws Exception {
  PrintWriter out = new PrintWriter(new FileWriter(ALLOC_FILE));
  out.println("<?xml version=\"1.0\"?>");
  out.println("<allocations>");
  // Give pool A a minimum of 1 map, 2 reduces
  out.println("<pool name=\"pool_a\">");
  out.println("<minMaps>1</minMaps>");
  out.println("<minReduces>2</minReduces>");
  out.println("<maxTotalInitedTasks>100000</maxTotalInitedTasks>");
  out.println("</pool>");
  // Give pool B a minimum of 2 maps, 1 reduce
  out.println("<pool name=\"pool_b\">");
  out.println("<minMaps>2</minMaps>");
  out.println("<minReduces>1</minReduces>");
  out.println("</pool>");
  // Give pool B a maximum of 4 maps, 2 reduce
  out.println("<pool name=\"pool_b\">");
  out.println("<maxMaps>4</maxMaps>");
  out.println("<maxReduces>2</maxReduces>");
  out.println("<maxTotalInitedTasks>20000</maxTotalInitedTasks>");
  out.println("</pool>");
  // Give pool C min maps but no min reduces
  out.println("<pool name=\"pool_c\">");
  out.println("<minMaps>2</minMaps>");
  out.println("</pool>");
  // Give pool C a maximum of 4 maps, no maximum reduces
  out.println("<pool name=\"pool_c\">");
  out.println("<maxMaps>4</maxMaps>");
  out.println("</pool>");
  // Give pool D a limit of 3 running jobs
  out.println("<pool name=\"pool_d\">");
  out.println("<maxRunningJobs>3</maxRunningJobs>");
  out.println("</pool>");
  // Give pool E a preemption timeout of one minute
  out.println("<pool name=\"pool_e\">");
  out.println("<minSharePreemptionTimeout>60</minSharePreemptionTimeout>");
  out.println("</pool>");
  // Set default limit of jobs per user to 5
  out.println("<userMaxJobsDefault>5</userMaxJobsDefault>");
  // Give user1 a limit of 10 jobs
  out.println("<user name=\"user1\">");
  out.println("<maxRunningJobs>10</maxRunningJobs>");
  out.println("</user>");
  // Set default min share preemption timeout to 2 minutes
  out.println("<defaultMinSharePreemptionTimeout>120"
      + "</defaultMinSharePreemptionTimeout>");
  // Set fair share preemption timeout to 5 minutes
  out.println("<fairSharePreemptionTimeout>300</fairSharePreemptionTimeout>");
  out.println("<defaultMaxTotalInitedTasks>50000" +
              "</defaultMaxTotalInitedTasks>");
  out.println("</allocations>");
  out.close();

  PoolManager poolManager = scheduler.getPoolManager();
  poolManager.reloadAllocs();

  assertEquals(6, poolManager.getPools().size()); // 5 in file + default pool
  assertEquals(0, poolManager.getMinSlots(Pool.DEFAULT_POOL_NAME,
      TaskType.MAP));
  assertEquals(0, poolManager.getMinSlots(Pool.DEFAULT_POOL_NAME,
      TaskType.REDUCE));
  assertEquals(1, poolManager.getMinSlots("pool_a", TaskType.MAP));
  assertEquals(2, poolManager.getMinSlots("pool_a", TaskType.REDUCE));
  assertEquals(2, poolManager.getMinSlots("pool_b", TaskType.MAP));
  assertEquals(1, poolManager.getMinSlots("pool_b", TaskType.REDUCE));
  assertEquals(2, poolManager.getMinSlots("pool_c", TaskType.MAP));
  assertEquals(0, poolManager.getMinSlots("pool_c", TaskType.REDUCE));
  assertEquals(0, poolManager.getMinSlots("pool_d", TaskType.MAP));
  assertEquals(0, poolManager.getMinSlots("pool_d", TaskType.REDUCE));
  assertEquals(0, poolManager.getMinSlots("pool_e", TaskType.MAP));
  assertEquals(0, poolManager.getMinSlots("pool_e", TaskType.REDUCE));
  assertEquals(10, poolManager.getUserMaxJobs("user1"));
  assertEquals(5, poolManager.getUserMaxJobs("user2"));
  assertEquals(4, poolManager.getMaxSlots("pool_b", TaskType.MAP));
  assertEquals(2, poolManager.getMaxSlots("pool_b", TaskType.REDUCE));
  assertEquals(4, poolManager.getMaxSlots("pool_c", TaskType.MAP));
  assertEquals(100000, poolManager.getPoolMaxInitedTasks("pool_a"));
  assertEquals(20000, poolManager.getPoolMaxInitedTasks("pool_b"));
  assertEquals(50000, poolManager.getPoolMaxInitedTasks("pool_c"));
  assertEquals(50000, poolManager.getPoolMaxInitedTasks("pool_d"));
  assertEquals(50000, poolManager.getPoolMaxInitedTasks("pool_e"));
  assertEquals(Integer.MAX_VALUE,
               poolManager.getMaxSlots("pool_c", TaskType.REDUCE));
  assertEquals(120000, poolManager.getMinSharePreemptionTimeout(
      Pool.DEFAULT_POOL_NAME));
  assertEquals(120000, poolManager.getMinSharePreemptionTimeout("pool_a"));
  assertEquals(120000, poolManager.getMinSharePreemptionTimeout("pool_b"));
  assertEquals(120000, poolManager.getMinSharePreemptionTimeout("pool_c"));
  assertEquals(120000, poolManager.getMinSharePreemptionTimeout("pool_d"));
  assertEquals(120000, poolManager.getMinSharePreemptionTimeout("pool_a"));
  assertEquals(60000, poolManager.getMinSharePreemptionTimeout("pool_e"));
  assertEquals(300000, poolManager.getFairSharePreemptionTimeout());
}
 
源代码17 项目: KEEL   文件: ResultsProccessor.java
public void writeToFile(String outName) throws FileNotFoundException, UnsupportedEncodingException
{
    calcMeans();
    calcAvgRulesBySeed();
    
    PrintWriter writer = new PrintWriter(outName, "UTF-8");
    
    // Get number of measures and header for the table from first element
    // "\\hline \n  \\textbf{Algorithm} & \\textbf{Soporte} & \\textbf{Confianza} \\\\ \\hline \\hline"
    String tableHeader = "\\textbf{Algorithm} ";
    
    
    for (String measureName : sortedMeasures)
    {
        tableHeader += "& \\textbf{"+ measureName +"} ";
    }
    
    tableHeader += "\\\\ \\hline \\hline";
    
    Integer measuresNumber = sortedMeasures.size();
    
    // Table columns are:
    // Algortihm || Support | Confianze | .....
    // Algorithm1 & 0.9 & 0.88 & .....
    // "\\begin{tabular}{ l || c | c | ...... }"
    String tableSettings = "\\begin{table*}[ht!]\n" +
                            "\\centering\n" +
                            "\\caption[Caption]{Something}\n" +
                            "\\label{table:label}\n" +
                            "\\scalebox{0.90}{ \n";
    tableSettings += "\\begin{tabular}{ l | ";
    for(int i=0;i<measuresNumber;i++)
    {
        tableSettings += "| c ";
    }
    tableSettings += "";
    tableSettings += "} \n \\hline";
    
    // Write Info, table settings and table header
    writer.println("\\documentclass{article} \n \\begin{document} \n\n % Copy only the table to your LaTeX file");
    writer.println(tableSettings);
    writer.println(tableHeader);
    
    
    // Write table content
    for (Map.Entry<String, HashMap<String, Double> > alg : algorithmMeasures.entrySet())
    {
        String algName = alg.getKey();
        HashMap<String, Double> measures = alg.getValue();
        
        // Parse algorithm name to show it correctly
        String aName = algName.substring(0, algName.length()-1);
        int startAlgName = aName.lastIndexOf("/");
        aName = aName.substring(startAlgName + 1);
        
        String algContent = aName + " ";
        
        for(int i=0;i<sortedMeasures.size();i++)
        {
            String m = String.format( "%.2f", measures.get(sortedMeasures.get(i)) );
            algContent += "& "+ m + " ";
        }
        
        algContent += "\\\\ \\hline";
        
        writer.println(algContent);
    }
    
    writer.println("\\end{tabular}}\n\\end{table*}  \n\n \\end{document}");
    
    writer.flush();
    writer.close();
}
 
源代码18 项目: birt   文件: RepoGen.java
private void createAntFile(final File antFile, final File pomFile, final String artifactId,
		final File jarFile, final boolean snapshot, final File sourceFile, final File javadocFile) throws IOException
{
	final PrintWriter pw = new PrintWriter(new FileWriter(antFile));
	try
	{
		pw.print("<project name=\"");
		pw.print(artifactId);
		pw.print("\" default=\"");
		pw.print(snapshot ? "deploy" : "stage");
		pw.println("\" basedir=\".\" xmlns:artifact=\"antlib:org.apache.maven.artifact.ant\">");
		if (snapshot)
		{
			pw.println(" <property name=\"maven-snapshots-repository-id\" value=\"sonatype-nexus-snapshots\"/>");
			pw.println(" <property name=\"maven-snapshots-repository-url\" value=\"https://oss.sonatype.org/content/repositories/snapshots\"/>");
			pw.println(" <target name=\"deploy\">");
			
			pw.println("  <artifact:mvn>");
			pw.println("   <arg value=\"org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file\"/>");
			pw.println("   <arg value=\"-Durl=${maven-snapshots-repository-url}\"/>");
			pw.println("   <arg value=\"-DrepositoryId=${maven-snapshots-repository-id}\"/>");
			pw.print("   <arg value=\"-DpomFile=");
			pw.print(pomFile);
			pw.println("\"/>");
			pw.print("   <arg value=\"-Dfile=");
			pw.print(jarFile);
			pw.println("\"/>");
			pw.println("  </artifact:mvn>");
			pw.println(" </target>");
		}
		else
		{
			pw.println(" <property name=\"maven-staging-repository-id\" value=\"sonatype-nexus-staging\" />");
			pw.println(" <property name=\"maven-staging-repository-url\" value=\"https://oss.sonatype.org/service/local/staging/deploy/maven2/\" />");
			pw.println(" <target name=\"stage\">");
			
			pw.println("  <artifact:mvn>");
			pw.println("   <arg value=\"org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file\" />");
			pw.println("   <arg value=\"-Durl=${maven-staging-repository-url}\" />");
			pw.println("   <arg value=\"-DrepositoryId=${maven-staging-repository-id}\" />");
			pw.print("   <arg value=\"-DpomFile=");
			pw.print(pomFile);
			pw.println("\"/>");
			pw.print("   <arg value=\"-Dfile=");
			pw.print(jarFile);
			pw.println("\"/>");
			pw.println("   <arg value=\"-Pgpg\"/>");
			pw.println("  </artifact:mvn>");
			
			pw.println("");
			pw.println("  <!-- deploy source jars -->");
			pw.println("  <artifact:mvn>");
			pw.println("   <arg value=\"org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file\" />");
			pw.println("   <arg value=\"-Durl=${maven-staging-repository-url}\"/>");
			pw.println("   <arg value=\"-DrepositoryId=${maven-staging-repository-id}\"/>");
			pw.print("   <arg value=\"-DpomFile=");
			pw.print(pomFile);
			pw.println("\"/>");
			pw.print("   <arg value=\"-Dfile=");
			pw.print(sourceFile);
			pw.println("\"/>");
			pw.println("   <arg value=\"-Dclassifier=sources\"/>");
			pw.println("   <arg value=\"-Pgpg\"/>");
			pw.println("  </artifact:mvn>");
			pw.println("");
			pw.println("  <!-- deploy javadoc jars -->");
			pw.println("  <artifact:mvn>");
			pw.println("   <arg value=\"org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file\" />");
			pw.println("   <arg value=\"-Durl=${maven-staging-repository-url}\"/>");
			pw.println("   <arg value=\"-DrepositoryId=${maven-staging-repository-id}\"/>");
			pw.print("   <arg value=\"-DpomFile=");
			pw.print(pomFile);
			pw.println("\"/>");
			pw.print("   <arg value=\"-Dfile=");
			pw.print(javadocFile);
			pw.println("\"/>");
			pw.println("   <arg value=\"-Dclassifier=javadoc\"/>");
			pw.println("   <arg value=\"-Pgpg\"/>");
			pw.println("  </artifact:mvn>");
			pw.println(" </target>");
		}
		pw.println("</project>");
	}
	finally
	{
		pw.close();
	}
}
 
源代码19 项目: tomcatsrc   文件: RequestParamExample.java
@Override
public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
    throws IOException, ServletException
{
    response.setContentType("text/html");

    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");

    String title = RB.getString("requestparams.title");
    out.println("<title>" + title + "</title>");
    out.println("</head>");
    out.println("<body bgcolor=\"white\">");

    // img stuff not req'd for source code html showing

   // all links relative

    // XXX
    // making these absolute till we work out the
    // addition of a PathInfo issue

    out.println("<a href=\"../reqparams.html\">");
    out.println("<img src=\"../images/code.gif\" height=24 " +
                "width=24 align=right border=0 alt=\"view code\"></a>");
    out.println("<a href=\"../index.html\">");
    out.println("<img src=\"../images/return.gif\" height=24 " +
                "width=24 align=right border=0 alt=\"return\"></a>");

    out.println("<h3>" + title + "</h3>");
    String firstName = request.getParameter("firstname");
    String lastName = request.getParameter("lastname");
    out.println(RB.getString("requestparams.params-in-req") + "<br>");
    if (firstName != null || lastName != null) {
        out.println(RB.getString("requestparams.firstname"));
        out.println(" = " + HTMLFilter.filter(firstName) + "<br>");
        out.println(RB.getString("requestparams.lastname"));
        out.println(" = " + HTMLFilter.filter(lastName));
    } else {
        out.println(RB.getString("requestparams.no-params"));
    }
    out.println("<P>");
    out.print("<form action=\"");
    out.print("RequestParamExample\" ");
    out.println("method=POST>");
    out.println(RB.getString("requestparams.firstname"));
    out.println("<input type=text size=20 name=firstname>");
    out.println("<br>");
    out.println(RB.getString("requestparams.lastname"));
    out.println("<input type=text size=20 name=lastname>");
    out.println("<br>");
    out.println("<input type=submit>");
    out.println("</form>");

    out.println("</body>");
    out.println("</html>");
}
 
/**
 * Print the help for the specified Options to the specified writer, 
 * using the specified width, left padding and description padding.
 *
 * @param pw The printWriter to write the help to
 * @param width The number of characters to display per line
 * @param options The command line Options
 * @param leftPad the number of characters of padding to be prefixed
 * to each line
 * @param descPad the number of characters of padding to be prefixed
 * to each description line
 */
public void printOptions(PrintWriter pw, int width, Options options, 
                         int leftPad, int descPad)
{
    StringBuffer sb = new StringBuffer();

    renderOptions(sb, width, options, leftPad, descPad);
    pw.println(sb.toString());
}