siom79 / jdrivesync

jdrivesync is a simple command line tool that synchronizes a local file system structure to your Google Drive (and back)

Home Page:https://siom79.github.io/jdrivesync/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting MalformedURLException while downloading files to local directory

alcazoid opened this issue · comments

Hi,

I am stuck with a problem while synchronizing files, in particular, trying to download files from GDrive to local directory.
I run it with following parameters: jds -d -r / -l /media/shared/gdrive/ where jds is a shortcut for java -jar ....
After syncing some files I'm getting the following exception trace:

2015-05-14 00:22:55 FINE jdrivesync.sync.Synchronization$2 processRemoteFilesWithoutLocalFile(): Downloading file '/Recon 2011.docx'.
2015-05-14 00:22:55 SEVERE jdrivesync.App main(): The following error occurred: java.net.MalformedURLException
java.lang.IllegalArgumentException: java.net.MalformedURLException
    at com.google.api.client.http.GenericUrl.parseURL(GenericUrl.java:638)
    at com.google.api.client.http.GenericUrl.<init>(GenericUrl.java:114)
    at jdrivesync.gdrive.GoogleDriveAdapter.downloadFile(GoogleDriveAdapter.java:162)
    at jdrivesync.sync.Synchronization$2.processRemoteFilesWithoutLocalFile(Synchronization.java:367)
    at jdrivesync.sync.Synchronization$2.visitDirectory(Synchronization.java:340)
    at jdrivesync.gdrive.GoogleDriveWalker.walkInternal(GoogleDriveWalker.java:85)
    at jdrivesync.gdrive.GoogleDriveWalker.walk(GoogleDriveWalker.java:34)
    at jdrivesync.sync.Synchronization.syncDown(Synchronization.java:315)
    at jdrivesync.App.sync(App.java:87)
    at jdrivesync.App.run(App.java:52)
    at jdrivesync.App.main(App.java:26)
Caused by: java.net.MalformedURLException
    at java.net.URL.<init>(URL.java:620)
    at java.net.URL.<init>(URL.java:483)
    at java.net.URL.<init>(URL.java:432)
    at com.google.api.client.http.GenericUrl.parseURL(GenericUrl.java:636)
    ... 10 more
Caused by: java.lang.NullPointerException
    at java.net.URL.<init>(URL.java:525)
    ... 13 more

If I re-run the command - it crashes again with the same FINE log entry as before, meaning it always crashes on the same file(I guess).
I'm running it on Linux box with Oracle Java 1.8.0.45.
I would be glad to provide more info on your request.
Thanks!

Hi,

this looks like Google Drive does not return a valid download URL for this file. I have seen this for Google Doc documents and fixed this issue in the new version 0.2.4. This version also checks the download URL returned from Google and outputs the metadata we get for this document.

Can you try to download the same set of files with the latest version and see if it is either fixed or post the output?

Hi,

thank you for a swift response. Yes, it is fixed in the latest version, as it doesn't download any google docs(as it is probably intended?).

Yes, I think this is intended.