Examples of openStream()


Examples of br.com.objectos.comuns.web.upload.UploadedFile.openStream()

        UploadedFile file = input.get();
        Attachment attach = new ProtoBuilder(baseDir, file).build();

        UUID uuid = attach.getUuid();
        InputStream in = file.openStream();
        AttachmentIO.write(baseDir, uuid, in);

        return pages.addPagesTo(attach);

      } catch (UploadRequestException e) {

Examples of com.dotcms.repackage.org.apache.commons.fileupload.FileItemStream.openStream()

        FileItemIterator iterator = null;
        try {
            iterator = upload.getItemIterator( request );
            while ( iterator.hasNext() ) {
                FileItemStream item = iterator.next();
                InputStream in = item.openStream();
                if ( item.getFieldName().equals( "bundleUpload" ) ) {
                    String fname = item.getName();
                    if ( !fname.endsWith( ".jar" ) ) {
                        Logger.warn( this, "Cannot deplpy bundle as it is not a JAR" );
                        writeError( response, "Cannot deplpy bundle as it is not a JAR" );

Examples of com.eteks.sweethome3d.tools.URLContent.openStream()

      // If content couldn't be loaded, try to load model as a zipped file
      ZipInputStream zipIn = null;
      try {
        URLContent urlContent = (URLContent)modelContent;
        // Open zipped stream
        zipIn = new ZipInputStream(urlContent.openStream());
        // Parse entries to see if a obj file is readable
        for (ZipEntry entry; (entry = zipIn.getNextEntry()) != null; ) {
          try {
            String entryName = entry.getName();
            // Ignore directory entries and entries starting by a dot

Examples of com.google.common.io.ByteSource.openStream()

                        }
                    }

                    // TODO: Open buffered stream??

                    return is.openStream();
                } catch (IOException e) {
                    throw new IllegalStateException("Error reading data", e);
                }
            }
        });

Examples of com.google.common.io.CharSink.openStream()

         MessageDigest digester = md5Digest();

         CharSink fileSink = Files.asCharSink(f, Charsets.UTF_8);
         Writer out = null;
         try {
            out = fileSink.openStream();
            for (long i = 0; i < length; i++) {
               out.append('a');
               digester.update((byte) 'a');
            }
            out.flush();

Examples of com.google.common.io.CharSource.openStream()

      NetHttpTransport httpTransport = new NetHttpTransport();
      JsonFactory jsonFactory = new JacksonFactory();

      URL url = Resources.getResource(GDrive.class, CLIENTSECRETS_LOCATION);
      CharSource charSource = Resources.asCharSource(url, Charsets.UTF_8);
      Reader reader = charSource.openStream();
      GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(jsonFactory, reader);

      GoogleCredential credential = new GoogleCredential.Builder()
          .setTransport(httpTransport)
          .setJsonFactory(jsonFactory)

Examples of com.heroku.api.request.log.LogStreamResponse.openStream()

public class LogStreamResponseTest {

    @Test
    public void testLogStream() throws IOException {
        LogStreamResponse response = new LogStreamResponse(new URL(Heroku.Config.ENDPOINT.value));
        response.openStream().close();
    }
}

Examples of com.jme3.asset.AssetInfo.openStream()

                assetManager.registerLoader(DatabaseLoader.class, "db");

                String levelFilename = "Files/" + settingsFile;
                AssetKey myKey1 = new AssetKey(levelFilename);
                AssetInfo info1 = assetManager.locateAsset(myKey1);
                InputStream inputStream = (InputStream) info1.openStream();

                OutputStream outStream = null;

                String absolutePath = "";

Examples of com.subgraph.orchid.HiddenServiceCircuit.openStream()

  public Stream getStreamTo(String onion, int port) throws OpenFailedException, InterruptedException, TimeoutException {
    final HiddenService hs = getHiddenServiceForOnion(onion);
    final HiddenServiceCircuit circuit = getCircuitTo(hs);
   
    try {
      return circuit.openStream(port, HS_STREAM_TIMEOUT);
    } catch (StreamConnectFailedException e) {
      throw new OpenFailedException("Failed to open stream to hidden service "+ hs.getOnionAddressForLogging() + " reason "+ e.getReason());
    }
  }
 

Examples of com.sun.media.sound.AudioSynthesizer.openStream()

                logger.warn("No AudioSynhtesizer was found!");
                return;
            }

            // Open AudioStream from AudioSynthesizer.
            AudioInputStream stream = synth.openStream(null, null);

            Generator.loadSoundbankInstruments(synth);
            // Play Sequence into AudioSynthesizer Receiver.
            double total = send(sequence, synth.getReceiver());
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.