Examples of openInputStream()


Examples of javax.tools.FileObject.openInputStream()

    InputStream ormStream;
    try {
      FileObject fileObject = context.getProcessingEnvironment()
          .getFiler()
          .getResource( StandardLocation.CLASS_OUTPUT, pkg, name );
      ormStream = fileObject.openInputStream();
    }
    catch ( IOException e1 ) {
      // TODO - METAGEN-12
      // unfortunately, the Filer.getResource API seems not to be able to load from /META-INF. One gets a
      // FilerException with the message with "Illegal name /META-INF". This means that we have to revert to
View Full Code Here

Examples of javax.tools.FileObject.openInputStream()

        Set<String> allServices = new HashSet<String>();
        try {
          FileObject existingFile = filer.getResource(StandardLocation.CLASS_OUTPUT, "",
              resourceFile);
          log("Looking for existing resource file at " + existingFile.toUri());
          Set<String> oldServices = ServicesFile.readServiceFile(existingFile.openInputStream());
          log("Existing service entries: " + oldServices);
          allServices.addAll(oldServices);
        } catch (IOException e) {
          log("Resource file did not already exist.");
        }
View Full Code Here

Examples of javax.tools.FileObject.openInputStream()

      FileObject existingFile = processingEnv.getFiler().getResource(
          StandardLocation.CLASS_OUTPUT, "", CALLBACKS_CONFIG_FILE);
      InputStream inputStream = null;
      if (existingFile != null) {
        try {
          inputStream = existingFile.openInputStream();
        } catch (IOException e) {
        }
      }
      callbacksConfigWriter = new DatastoreCallbacksConfigWriter(inputStream);
      if (inputStream != null) {
View Full Code Here

Examples of javax.tools.JavaFileObject.openInputStream()

        JavaFileObject file = jfm.getJavaFileForInput(StandardLocation.CLASS_OUTPUT,
                                                      name, Kind.CLASS);
        if (file == null) {
          throw new FileNotFoundException();
        }
        byte[] bytes = ByteStreams.toByteArray(file.openInputStream());
        return defineClass(name, bytes, 0, bytes.length);
      } catch (IOException e) {
        throw new ClassNotFoundException();
      }
    }
View Full Code Here

Examples of jodd.http.up.Uploadable.openInputStream()

        writer.write(new String(array, StringPool.ISO_8859_1));
      }
      else if (o instanceof Uploadable) {
        Uploadable uploadable = (Uploadable) o;

        InputStream inputStream = uploadable.openInputStream();

        try {
          StreamUtil.copy(inputStream, writer, StringPool.ISO_8859_1);
        }
        finally {
View Full Code Here

Examples of org.akubraproject.Blob.openInputStream()

  }

  public InputStream get(String pid, String dsId) throws IOException {
    BlobStoreConnection connection = openConnection(blobStore);
    Blob blob = getBlob(connection, pid, dsId);
    return blob.openInputStream();
  }

  public List<URI> list(String filterPrefix) throws IOException {
    List<URI> ids = new ArrayList<URI>();
    BlobStoreConnection connection = openConnection(blobStore);
View Full Code Here

Examples of org.akubraproject.Blob.openInputStream()

    // openInputStream on non-existent blob
    shouldFail(new ConAction() {
      public void run(BlobStoreConnection con) throws Exception {
        Blob b = getBlob(con, id1, false);
        b.openInputStream().close();
      }
    }, MissingBlobException.class, id1);

    // openInputStream on existing blob
    runTests(new ConAction() {
View Full Code Here

Examples of org.akubraproject.Blob.openInputStream()

          createBlob(con, b, body);

          // read partial body
          byte[] buf = new byte[100];

          InputStream is = b.openInputStream();
          int got = is.read(buf, 0, 10);
          assertTrue(got > 0 && got <= 10, "Invalid number of bytes read: " + got);
          int len = got;
          is.close();
          assertEquals(new String(buf, 0, len, "UTF-8"), body.substring(0, len));
View Full Code Here

Examples of org.akubraproject.Blob.openInputStream()

          assertTrue(got > 0 && got <= 10, "Invalid number of bytes read: " + got);
          int len = got;
          is.close();
          assertEquals(new String(buf, 0, len, "UTF-8"), body.substring(0, len));

          is = b.openInputStream();
          got = 0;
          while (got < len) {
            int skipped = (int) is.skip(len - got);
            assertTrue(skipped > 0 && skipped <= (len - got),
                       "Invalid number of bytes skipped: " + skipped);
View Full Code Here

Examples of org.albite.util.archive.ArchiveEntry.openInputStream()

        if (container == null) {
            throw new BookException("Missing manifest");
        }

        in = container.openInputStream();

        try {
            KXmlParser parser = null;
            Document doc = null;
            Element root;
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.