Package org.apache.camel.component.salesforce.dto.generated

Examples of org.apache.camel.component.salesforce.dto.generated.Document


    public void doTestGetBlobField(String suffix) throws Exception {
        // get document with Name "Test Document"
        final HashMap<String, Object> headers = new HashMap<String, Object>();
        headers.put(SalesforceEndpointConfig.SOBJECT_NAME, "Document");
        headers.put(SalesforceEndpointConfig.SOBJECT_EXT_ID_NAME, "Name");
        Document document = template().requestBodyAndHeaders("direct:getSObjectWithId" + suffix, TEST_DOCUMENT_ID,
            headers, Document.class);
        assertNotNull(document);
        LOG.debug("GetWithId: {}", document);

        // get Body field for this document
        InputStream body = template().requestBody("direct:getBlobField" + suffix, document, InputStream.class);
        assertNotNull(body);
        LOG.debug("GetBlobField: {}", body);
        // write body to test file
        final FileChannel fileChannel = new FileOutputStream("target/getBlobField" + suffix + ".txt").getChannel();
        final ReadableByteChannel src = Channels.newChannel(body);
        fileChannel.transferFrom(src, 0, document.getBodyLength());
        fileChannel.close();
        src.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.salesforce.dto.generated.Document

Copyright © 2018 www.massapicom. 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.