Examples of readFrom()


Examples of org.apache.ambari.view.URLStreamProvider.readFrom()

    try {
      URLStreamProvider streamProvider = context.getURLStreamProvider();
      InputStream jmxStream = null;
      Map<String, String> headers = new HashMap<String, String>();
      try {
        jmxStream = streamProvider.readFrom(jmxUrl, "GET", null, headers);
      } catch (IOException e) {
        logger.error(String.format(
            "Unable to access JMX endpoint at %s. Error %s", jmxUrl,
            e.getMessage()));
      }
View Full Code Here

Examples of org.apache.clerezza.jaxrs.utils.form.MultiPartFormMessageBodyReader.readFrom()

    InputStream entityStream = new ByteArrayInputStream(message);
   
    MultiPartFormMessageBodyReader multiPartFormMBR = new MultiPartFormMessageBodyReader();
    MediaType mediaType = MediaType.valueOf("multipart/form-data; boundary=AaB03x");
   
    MultiPartBody multiPartBody = multiPartFormMBR.readFrom(null, null, null, mediaType, null, entityStream);
   
    String[] paramNames = multiPartBody.getParameterNames();
    String[] expectedParamNames = {paramName1, paramName2, paramName3};
    System.out.println(Arrays.toString(paramNames));
    Assert.assertArrayEquals(expectedParamNames, paramNames);
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.JSONProvider.readFrom()

    }
   
    @SuppressWarnings("unchecked")
    private Book readJSONBookFromInputStream(InputStream is) throws Exception {
        JSONProvider provider = new JSONProvider();
        return (Book)provider.readFrom((Class)Book.class, Book.class, new Annotation[]{},
                                 MediaType.APPLICATION_JSON_TYPE, null, is);
       
    }
}
View Full Code Here

Examples of org.apache.flex.swf.io.SWFReader.readFrom()

                    // Read in the SWF
                    in = new BufferedInputStream(new FileInputStream(inputFile));
                    SWFReader reader = new SWFReader();
                    try
                    {
                        ISWF swf = reader.readFrom(in, getInputFilePath());
                        // record any problems encountered reading the swf
                        problems.addAll(reader.getProblems());

                        List<ICompilerProblem> linkProblems = new ArrayList<ICompilerProblem>();
   
View Full Code Here

Examples of org.apache.poi.xssf.model.CommentsTable.readFrom()

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);

        CommentsTable sheetComments = new CommentsTable();
        sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));
        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
        assertEquals(TEST_AUTHOR, comment.getAuthor());
    }

    public void testSetColumn() {
View Full Code Here

Examples of org.apache.synapse.commons.util.TemporaryData.readFrom()

    private void testReadFrom(int size) throws IOException {
        byte[] data = new byte[size];
        random.nextBytes(data);
        TemporaryData tmp = new TemporaryData(16, 1024, "test", ".dat");
        try {
            tmp.readFrom(new ByteArrayInputStream(data));
            InputStream in = tmp.getInputStream();
            try {
                assertTrue(Arrays.equals(data, IOUtils.toByteArray(in)));
            }
            finally {
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.DataSourceProvider.readFrom()

        DataSource ds = null;
        try {
            // Read Entity
            ds =
                dsp
                    .readFrom(null, null, null, MediaType.WILDCARD_TYPE, null, bads
                        .getInputStream());
        } catch (IOException e) {
            assertFalse(" Failed to read Entity", true);
        }
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.FormMultivaluedMapProvider.readFrom()

        assertTrue(provider.isReadable(rawType,
                                       type,
                                       null,
                                       MediaType.APPLICATION_FORM_URLENCODED_TYPE));
        MultivaluedMap<String, String> map =
            provider.readFrom(rawType,
                              type,
                              null,
                              MediaType.APPLICATION_FORM_URLENCODED_TYPE,
                              null,
                              new ByteArrayInputStream(FORM_BYTES));
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.ReaderProvider.readFrom()

                                                                                 null));

        Reader reader = null;
        try {
            // Read Entity
            reader = rp.readFrom(null, null, null, MediaType.WILDCARD_TYPE, null, bais);
        } catch (IOException e) {
            assertFalse(" Failed to read Entity", true);
        }

        BufferedReader sr = new BufferedReader(reader);
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.StringProvider.readFrom()

        assertEquals(200, response.getStatusCode());
        InputStream is = response.getEntity(InputStream.class);
        GZIPInputStream gzipIS = new GZIPInputStream(is);
        StringProvider sp = new StringProvider();
        String responseEntity =
            sp.readFrom(String.class,
                        String.class,
                        new Annotation[] {},
                        MediaType.TEXT_PLAIN_TYPE,
                        null,
                        gzipIS);
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.