filestack / filestack-java

Official Java SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://filestack.com
Apache License 2.0
18 stars 18 forks source link

Support uploading of InputStreams #50

Closed shawnmaten closed 6 years ago

shawnmaten commented 6 years ago

We need to be able to upload from InputStream objects so that we can properly support local uploads in Android. This will require refactoring the Upload* classes a bit. I think the main issue will just be rethinking how we divide the work between multiple workers. Right now we assign a (worker / thread / observable) a section of a file to read and upload. Instead we should have multiple workers that independently read and upload from a shared InputStream. That reading will have to be synchronized, but otherwise I don't think this will be too much of a problem. To keep support of uploading with a file system path, and not overcomplicate things, we should just convert file system paths to InputStreams.