I'm new to this form,
I was getting an OutOfMemoryError
while trying to upload a large file to dropbox via java dropbox sdk.
Here is my scenario :
Server A contains a file (>1GB) --> Server B opens a stream and passes that stream to dropbox api in java
Here is my code :
DbxRequestConfig config = new DbxRequestConfig("dropbox/java-tutorial","en_US");
DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);
try {
URL url = new URL(url_d);
// Upload Files to Dropbox
String fileName = url_d.substring( url_d.lastIndexOf('/')+1, url_d.length() );
DbxFiles.FileMetadata metadata = client.files.uploadBuilder("/"+fileName).run(url.openStream());
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (UploadException e) {
e.printStackTrace();
} catch (DbxException e) {
e.printStackTrace();
}
Can anyone give me a solution. Thank you.