You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openjdk version "17.0.11" 2024-04-16
OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
OpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode)
jdk 21 :
openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)
version :0.127.19
Steps to reproduce
Hello,
Trying to copy a file from a GCP bucket to my application, I noticed that using the method Path#copy(Path, Path, CopyOption...) is throwing an exception with java 21, although it was working well with java 17.
Here is an example of code :
publicstaticvoidmain(String[] args) {
try {
PathbucketSource = Paths.get(newURI("gs://my-bucket/file.txt"));
//copy with FileOutputStreamFiles.copy(bucketSource, newFileOutputStream("./target/fos.txt"));
System.out.println("copy with FileOutputStream : ok");
//copy with PathFiles.copy(bucketSource, Paths.get("./target/path.txt"));
System.out.println("copy with Path : ok");
} catch (Exceptionex) {
ex.printStackTrace();
}
}
Execution with java 17 :
/Users/ALEXANDRE/.sdkman/candidates/java/17.0.11-tem/bin/java ...
copy with FileOutputStream : ok
copy with Path : ok
Process finished with exit code 0
Execution with java 21 :
/Users/ALEXANDRE/.sdkman/candidates/java/21.0.3-tem/bin/java ...
copy with FileOutputStream : ok
java.lang.UnsupportedOperationException: PosixFileAttributeView
at com.google.cloud.storage.contrib.nio.CloudStorageFileSystemProvider.getFileAttributeView(CloudStorageFileSystemProvider.java:1023)
at java.base/java.nio.file.Files.getFileAttributeView(Files.java:1790)
at java.base/java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:110)
at java.base/java.nio.file.Files.copy(Files.java:1307)
at Stat.main(Stat.java:19)
Process finished with exit code 0
Thanks!
The text was updated successfully, but these errors were encountered:
Environment details
OS type and version :
Java version :
version :
0.127.19
Steps to reproduce
Hello,
Trying to copy a file from a GCP bucket to my application, I noticed that using the method
Path#copy(Path, Path, CopyOption...)
is throwing an exception with java 21, although it was working well with java 17.Here is an example of code :
Execution with java 17 :
Execution with java 21 :
Thanks!
The text was updated successfully, but these errors were encountered: