10BC0 google-cloud-nio: CloudStorageFileSystemProvider throws UnsupportedException when used with Webflux + MultipartFile upload · Issue #4702 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

google-cloud-nio: CloudStorageFileSystemProvider throws UnsupportedException when used with Webflux + MultipartFile upload #4702

@mcgin

Description

@mcgin

Because CloudStorageFileSystemProvider does not override the newFileChannel method it throws an UnsupportedOperationException when used for Multipart file uploads with FilePart.transferto(Path path) in a reactive Spring boot application.

Environment details

  1. Specify the API: google-cloud-nio
  2. OS type and version: Debian 9
  3. Java version: 10
  4. google-cloud-nio version(s): 0.83-alpha

Steps to reproduce

  1. See code sample

Code example

    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public Mono<Void> multipartUpload( final @RequestPart("file") FilePart filePart
    ) {

        FileSystem fileSystem = CloudStorageFileSystem.forBucket("my-bucket");
        return filePart.transferTo(fileSystem.getPath("failed-file"));
    }

Stack trace

java.lang.UnsupportedOperationException: null
    at java.base/java.nio.file.spi.FileSystemProvider.newFileChannel(FileSystemProvider.java:524)
    at java.base/java.nio.channels.FileChannel.open(FileChannel.java:292)
    at java.base/java.nio.channels.FileChannel.open(FileChannel.java:345)
    at org.springframework.http.codec.multipart.SynchronossPartHttpMessageReader$SynchronossFilePart.transferTo(SynchronossPartHttpMessageReader.java:334)

External references such as API reference guides used

Any additional information below

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0