<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Download a file from the Dropbox account into an output stream. in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-a-file-from-the-Dropbox-account-into-an-output-stream/m-p/101477#M3045</link>
    <description>&lt;P&gt;The &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.html#getFile(java.lang.String,%20java.lang.String,%20java.io.OutputStream)" rel="nofollow noreferrer"&gt;&lt;CODE&gt;getFile&lt;/CODE&gt;&lt;/A&gt; method will just write the file contents to whatever &lt;CODE&gt;OutputStream&lt;/CODE&gt; you supply, which doesn't necessarily need to be a &lt;CODE&gt;FileOutputStream&lt;/CODE&gt; like the example in the documentation shows. That being the case, you supply a different kind of &lt;CODE&gt;OutputStream&lt;/CODE&gt; to send the data to wherever you want. For example, a &lt;CODE&gt;PipedOutputStream&lt;/CODE&gt; may make sense, depending on your scenario.&lt;/P&gt;

&lt;P&gt;Alternatively, you may want to use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.html#startGetFile(java.lang.String,%20java.lang.String)" rel="nofollow noreferrer"&gt;&lt;CODE&gt;startGetFile&lt;/CODE&gt;&lt;/A&gt; which returns a &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.Downloader.html" rel="nofollow noreferrer"&gt;&lt;CODE&gt;DbxClient.Downloader&lt;/CODE&gt;&lt;/A&gt; instead, which has an &lt;CODE&gt;InputStream&lt;/CODE&gt; with the file's contents as the &lt;CODE&gt;body&lt;/CODE&gt; field, which may suit your use case better.&lt;/P&gt;</description>
    <pubDate>Thu, 28 May 2015 06:40:10 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-05-28T06:40:10Z</dc:date>
    <item>
      <title>Download a file from the Dropbox account into an output stream.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-a-file-from-the-Dropbox-account-into-an-output-stream/m-p/101476#M3044</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
I download a file from Dropbox using the following code from the Dropbox API:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;public final OutputStream downloadDropBoxFileAtOutputStream(final String dropBoxFilePath, String localFilePath) {
    OutputStream outputStream = null;
    try {
        outputStream = new FileOutputStream(localFilePath);
    } catch (FileNotFoundException e) {
        LOGGER.error(e.getMessage());
    }
    try {
        DbxEntry.File downloadedFile = null;
        try {
            downloadedFile = client.getFile(dropBoxFilePath, null,
                    outputStream);
        } catch (DbxException | IOException e) {
            LOGGER.error(e.getMessage());
        }
    } finally {
        try {
            outputStream.close();
        } catch (IOException e) {
            LOGGER.error(e.getMessage());
        }
    }
    return outputStream;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to pass the resulted output stream to another method without saving the file on the local disk. Is is this possible with the Dropbox core java API ? &lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
Aurelian&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:42:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-a-file-from-the-Dropbox-account-into-an-output-stream/m-p/101476#M3044</guid>
      <dc:creator>Aurelian R.</dc:creator>
      <dc:date>2019-05-29T09:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Download a file from the Dropbox account into an output stream.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-a-file-from-the-Dropbox-account-into-an-output-stream/m-p/101477#M3045</link>
      <description>&lt;P&gt;The &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.html#getFile(java.lang.String,%20java.lang.String,%20java.io.OutputStream)" rel="nofollow noreferrer"&gt;&lt;CODE&gt;getFile&lt;/CODE&gt;&lt;/A&gt; method will just write the file contents to whatever &lt;CODE&gt;OutputStream&lt;/CODE&gt; you supply, which doesn't necessarily need to be a &lt;CODE&gt;FileOutputStream&lt;/CODE&gt; like the example in the documentation shows. That being the case, you supply a different kind of &lt;CODE&gt;OutputStream&lt;/CODE&gt; to send the data to wherever you want. For example, a &lt;CODE&gt;PipedOutputStream&lt;/CODE&gt; may make sense, depending on your scenario.&lt;/P&gt;

&lt;P&gt;Alternatively, you may want to use &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.html#startGetFile(java.lang.String,%20java.lang.String)" rel="nofollow noreferrer"&gt;&lt;CODE&gt;startGetFile&lt;/CODE&gt;&lt;/A&gt; which returns a &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.Downloader.html" rel="nofollow noreferrer"&gt;&lt;CODE&gt;DbxClient.Downloader&lt;/CODE&gt;&lt;/A&gt; instead, which has an &lt;CODE&gt;InputStream&lt;/CODE&gt; with the file's contents as the &lt;CODE&gt;body&lt;/CODE&gt; field, which may suit your use case better.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 06:40:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-a-file-from-the-Dropbox-account-into-an-output-stream/m-p/101477#M3045</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-05-28T06:40:10Z</dc:date>
    </item>
  </channel>
</rss>

