I am trying to use Java's NIO filesystem to move files from a zip folder to a regular folder in Windows. And it is meant to be used by a custom function in Matlab.
However, when I tried in Matlab cmd the followings,
>> version -release
ans =
'2020b'
>> version -java
ans =
'Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode'
%%%%
FilePath=java.nio.file.Paths.get('C:\test',javaArray('java.lang.String', 0));
FileSystem=java.nio.file.FileSystems.newFileSystem(FilePath,[]);
I get the Provider not found
exception:
Java exception occurred:
java.nio.file.ProviderNotFoundException: Provider not found
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:407)
I would not get the exception and would be able to use the methods in NIO filesystem if the path was a zip file and not a regular folder in Windows.
In case an answer of this question applies, I also tried the following but to no avail.
>> FileSystem=java.nio.file.FileSystems.newFileSystem(FilePath,java.util.HashMap);
No method 'java.nio.file.FileSystems.newFileSystem' with matching signature found.
How do I use Java NIO filesystem for a Windows folder in Matlab?
(I am actually not sure if NIO filesystem can unzip automatically. But even if zip files are not involved, the error is encountered when reading regular folders.)