3

On Android I am able to upload an object Ok. But when I try to download it, I get the following error on getObject.executeMediaAndDownloadTo(out).

java.lang.IllegalArgumentException: Type must be in the 'maintype/subtype; parameter=value' format

Code is from the Google example:

Storage.Objects.Get getObject = storage.objects().get("bucket", "myObject");
if (getMetadata == true) {
    getObject.setAlt("json");  // Temporary workaround.
    StorageObject object = getObject.execute();
} else {
    // Downloading data.
    out = new ByteArrayOutputStream();
    // If you're not in AppEngine, download the whole thing in one request, if possible.
    // NOTE: As of right now, this will not retry on retryable failure.
    // http://code.google.com/p/google-api-java-client/issues/detail?id=579
    getObject.getMediaHttpDownloader().setDirectDownloadEnabled(true);
    getObject.executeMediaAndDownloadTo(out);
    }
Brian Dorsey
  • 4,588
  • 24
  • 27
user2051851
  • 121
  • 5
  • What version of the java library are you using? The latest is 1.15.0-rc https://developers.google.com/storage/docs/json_api/v1/api-lib/java – fejta May 21 '13 at 21:42
  • I did not quite understand the Java API. Can you share the code snippet with which you uploaded your objects? – Gopinath Jul 28 '13 at 14:40

0 Answers0