0

I need to Write Data in File(GCS BUCKET FILE) in Append Mode But I am Getting Error

java.lang.UnsupportedOperationException: APPEND

The Code Which I Wrote is:

FileSystem fs = FileSystems.getFileSystem(URI.create("gs://test"));
                   byte[] data = "hello world".getBytes(StandardCharsets.UTF_8);
                   Path path = fs.getPath("/Testing");
                   Files.write(path, data,StandardOpenOption.CREATE,StandardOpenOption.APPEND );

Is it a Bug or I am Missing Something ?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
BackBenChers
  • 304
  • 2
  • 15

1 Answers1

2

As far as I'm aware, none of the popular public cloud file storages support appending to objects (only overwriting), and Google Cloud Storage is no exception. E.g. see similar question about S3 and Azure.

jkff
  • 17,623
  • 5
  • 53
  • 85