Examples of openWriter()


Examples of com.caucho.server.cache.AbstractCacheEntry.openWriter()

    cacheEntry.setForwardEnclosed(_response.isForwardEnclosed());

    if (isByte)
      _cacheStream = cacheEntry.openOutputStream();
    else
      _cacheWriter = cacheEntry.openWriter();
  }

  /**
   * flushing
   */
 
View Full Code Here

Examples of com.caucho.server.cache.AbstractCacheEntry.openWriter()

    }
    else if (isByte) {
      setByteCacheStream(newCacheEntry.openOutputStream());
    }
    else {
      setCharCacheStream(newCacheEntry.openWriter());
    }
  }

  private void writeCache(byte []buf, int offset, int length)
    throws IOException
View Full Code Here

Examples of com.google.gxp.compiler.fs.FileRef.openWriter()

        String suffix = String.format(".%02d.%s.dot", i,
                                      phase.name().toLowerCase().replace("_", "-"));
        for (CompilationUnit compilationUnit : compilationUnits) {
          FileRef fileRef = compilationUnit.getSourceFileRef().removeExtension().addSuffix(suffix);
          try {
            Writer writer = fileRef.openWriter(Charsets.US_ASCII);
            try {
              DotWriter out = new DotWriter(writer);
              GraphRenderer<Object> renderer =
                  new ReflectiveGraphRenderer(phase.name().toLowerCase());
              renderer.renderGraph(out, phase.getForest(compilationUnit).getChildren());
View Full Code Here

Examples of com.google.gxp.compiler.fs.FileRef.openWriter()

                               AlertSink alertSink,
                               OutputLanguage... outputLanguages)
      throws Exception {
    // Create source file.
    FileRef gxpFileRef = fs.parseFilename("inmemory/gxp/test/Main.gxp");
    Writer gxpFile = gxpFileRef.openWriter(Charsets.US_ASCII);
    gxpFile.write(gxpSource);
    gxpFile.close();

    // Compile it.
    SchemaFactory schemaFactory = BuiltinSchemaFactory.INSTANCE;
View Full Code Here

Examples of com.google.gxp.compiler.fs.FileRef.openWriter()

  }

  public void testParameterFile() throws Exception {
    InMemoryFileSystem inMemory = new InMemoryFileSystem();
    FileRef parameterFile = inMemory.parseFilename("/here/params");
    Writer out = parameterFile.openWriter();
    out.write("--help");
    out.close();
    GxpcFlags flags = new GxpcFlags(inMemory, inMemory.parseFilename("/here"), "@params");
    assertTrue(flags.showHelp());
  }
View Full Code Here

Examples of com.google.gxp.compiler.fs.FileRef.openWriter()

  }

  public void testParameterFileIsUtf8() throws Exception {
    InMemoryFileSystem inMemory = new InMemoryFileSystem();
    FileRef parameterFile = inMemory.parseFilename("/here/params");
    Writer out = parameterFile.openWriter(Charsets.UTF_8);
    out.write("--output /here/\u00F6"); // An oe umlaut.
    out.close();
    GxpcFlags flags = new GxpcFlags(inMemory, inMemory.parseFilename("/here"), "@params");
    assertEquals("/here/\u00F6", flags.getAllowedOutputFiles().iterator().next().toFilename());
  }
View Full Code Here

Examples of javax.tools.FileObject.openWriter()

    }

    private void createMappingFile(TreeMap<String, String> uriMap) {
        try {
            FileObject fo = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT,"",CONFIG_PROPERTIES);
            Writer w = fo.openWriter();
            for (String uri : uriMap.keySet()) {
                w.append(uri);
                w.append("=");
                w.append(uriMap.get(uri));
                w.append('\n');
View Full Code Here

Examples of javax.tools.FileObject.openWriter()

                FileObject resource = processingEnv.getFiler().createResource(
                        StandardLocation.CLASS_OUTPUT,
                        "com.example",
                        "example.properties");
                Writer rw = resource.openWriter();
                rw.write("example=OK");
                rw.close();
            } catch (IOException e) {
                throw new AssertionError(e);
            }
View Full Code Here

Examples of javax.tools.FileObject.openWriter()

    try {
      final String path = "checkstyle-tobago.xml";
      final String name = (StringUtils.isNotBlank(targetCheckstyle) ? targetCheckstyle + '/' : "") + path;
      final FileObject resource = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT, "", name);
      info("Writing to file: " + resource.toUri());
      writer = resource.openWriter();

      TransformerFactory transFactory = TransformerFactory.newInstance();
      transFactory.setAttribute("indent-number", 2);
      Transformer transformer = transFactory.newTransformer();
      transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "-//Puppy Crawl//DTD Check Configuration 1.2//EN");
View Full Code Here

Examples of javax.tools.FileObject.openWriter()

    Writer writer = null;
    try {
      final FileObject resource = processingEnv.getFiler().createSourceFile(
          info.getPackageName() + '.' + info.getClassName());
      info("Writing to file: " + resource.toUri());
      writer = resource.openWriter();

      writer.append(stringTemplate.toString());
    } finally {
      IOUtils.closeQuietly(writer);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.