I'm trying to download a dropbox link to a file output.txt
. Something like this:
URL link = new URL("https://dl.dropboxusercontent.com/1/view/XXX/file.txt");
ReadableByteChannel rbc = Channels.newChannel(link.openStream());
FileOutputStream fos = new FileOutputStream("output.txt");
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
When I'm running my app in development (i.e. activator run
) this works fine. When the app is staged and deployed in production, I get a connection timeout at the link.openStream()
step:
play.api.UnexpectedException: Unexpected exception[ConnectException: Connection timed out]
I'm able to save any http files or websites to file in production. It just seems to time out on any https file. Any thoughts on how I could begin to tackle this?
Does this have anything to do with play or is it a configuration issue with my apache server?
Thanks