Examples of inputStream()


Examples of ariba.ui.aribaweb.util.AWResource.inputStream()

        if (filename != null) {
            AWResource resource = resourceManager().resourceNamed(filename);
            if (resource != null) {
                htmlString = (String)resource.object();
                if ((htmlString == null) || (AWConcreteApplication.IsRapidTurnaroundEnabled && resource.hasChanged())) {
                    InputStream inputStream = resource.inputStream();
                    inputStream = new BufferedInputStream(inputStream);
                    htmlString = AWUtil.stringWithContentsOfInputStream(inputStream,
                        booleanValueForBinding("expectEncoding"));
                    AWUtil.close(inputStream);
                    if (htmlString == null) {
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.Excerpt.inputStream()

        excerpt.index(0);
        assertEquals(293, excerpt.remaining());

        // a new ObjectInputStream is required for each record as they are not reusable :(
        ObjectInputStream cois = new ObjectInputStream(excerpt.inputStream());
        List objects2 = (List) cois.readObject();
        assertEquals(objects, objects2);
    }
}
View Full Code Here

Examples of org.netmelody.cieye.server.response.CiEyeResponse.inputStream()

        context.checking(new Expectations() {{
            allowing(spyIntermediary).briefingOn(feature); will(returnValue(briefing));
        }});
       
        final CiEyeResponse response = responder.respond(null);
        assertThat(IOUtils.toString(response.inputStream()), startsWith("{\"targets\":[]}"));
    }

}
View Full Code Here

Examples of org.netmelody.cieye.server.response.CiEyeResponse.inputStream()

            allowing(configFetcher).getVersion(); will(returnValue("myVersion"));
            ignoring(updateChecker);
        }});
       
        final CiEyeResponse response = ciEyeVersionResponder.respond(null);
        assertThat(IOUtils.toString(response.inputStream()), containsString("\"currentServerVersion\":\"myVersion\""));
    }
   
    @Test public void
    providesJsonWithLatestVersionInformation() throws IOException {
        context.checking(new Expectations() {{
View Full Code Here

Examples of org.netmelody.cieye.server.response.CiEyeResponse.inputStream()

            ignoring(configFetcher);
        }});
       
        final CiEyeResponse response = ciEyeVersionResponder.respond(null);
       
        assertThat(IOUtils.toString(response.inputStream()), containsString("\"latestServerVersion\":\"myNewVersion\""));
    }

}
View Full Code Here

Examples of org.netmelody.cieye.server.response.CiEyeResponse.inputStream()

            response.setCode(result.status.getCode());
            response.setText(result.status.getDescription());
            for (Entry<String, String> header : result.additionalStringHeaders.entrySet()) {
                response.set(header.getKey(), header.getValue());
            }
            IOUtils.copy(result.inputStream(), response.getOutputStream());
        }
        catch (Exception e) {
            LOG.error("Failed to respond to request for resource " + request.getPath().getPath(), e);
            response.setCode(Status.NOT_FOUND.getCode());
            response.setText(Status.NOT_FOUND.getDescription());
View Full Code Here

Examples of play.vfs.VirtualFile.inputstream()

            VirtualFile conf = vf.child("conf/greenscript.conf");
            if (conf.exists()) {
                //info_("loading dependency configuration from %1$s", conf.getRealFile().getAbsolutePath());
                try {
                    Properties p0 = new Properties();
                    p0.load(new BufferedInputStream(conf.inputstream()));
                    for (String k : p0.stringPropertyNames()) {
                        //info_("loading property: %s", k);
                        if (!p.containsKey(k)) {
                            info_("loading property for %s: %s", k, p0.get(k));
                            p.put(k, p0.get(k));
View Full Code Here

Examples of play.vfs.VirtualFile.inputstream()

                } else {
                    if (Play.mode == Play.Mode.DEV) {
                        grizzlyResponse.setHeader("Cache-Control", "no-cache");
                        grizzlyResponse.setHeader("Content-Length", String.valueOf(file.length()));
                        if (!grizzlyRequest.getMethod().equals("HEAD")) {
                            copyStream(grizzlyResponse, file.inputstream());
                        } else {
                            copyStream(grizzlyResponse, new ByteArrayInputStream(new byte[0]));
                        }
                    } else {
                        long last = file.lastModified();
View Full Code Here

Examples of play.vfs.VirtualFile.inputstream()

                            grizzlyResponse.setStatus(304);
                        } else {
                            grizzlyResponse.setHeader("Last-Modified", Utils.getHttpDateFormatter().format(new Date(last)));
                            grizzlyResponse.setHeader("Cache-Control", "max-age=" + Play.configuration.getProperty("http.cacheControl", "3600"));
                            grizzlyResponse.setHeader("Etag", etag);
                            copyStream(grizzlyResponse, file.inputstream());
                        }
                    }

                }
            } catch (IOException e) {
View Full Code Here

Examples of play.vfs.VirtualFile.inputstream()

            } else {
                if (Play.mode == Play.Mode.DEV) {
                    servletResponse.setHeader("Cache-Control", "no-cache");
                    servletResponse.setHeader("Content-Length", String.valueOf(file.length()));
                    if (!servletRequest.getMethod().equals("HEAD")) {
                        copyStream(servletResponse, file.inputstream());
                    } else {
                        copyStream(servletResponse, new ByteArrayInputStream(new byte[0]));
                    }
                } else {
                    long last = file.lastModified();
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.