I have java 8 project deployed on win 11 OS and I want to read a folder content that is found on MacOS apple M1 file system. Win 11 is connected to Mac OS via SMB.
I have a more then 100 files in folder and they have long file names.
Files.walkFileTree(path, EnumSet.allOf(FileVisitOption.class), maxDepth, filesVisitor);
When java code tries to read from the folder I am getting exception:
[2024-01-29T13:36:07,125] ERROR com.commands.ListFilesCommand(100) execute (http-nio-127.0.0.1-8080-exec-10)- Requested folder cannot be read
java.nio.file.FileSystemException: \\192.168.1.110\TEMP\TEST\test: Invalid Signature.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) ~[?:1.8.0_392]
at sun.nio.fs.WindowsException.asIOException(WindowsException.java:106) ~[?:1.8.0_392]
at sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.readNextEntry(WindowsDirectoryStream.java:178) ~[?:1.8.0_392]
at sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.hasNext(WindowsDirectoryStream.java:209) ~[?:1.8.0_392]
at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:348) ~[?:1.8.0_392]
at java.nio.file.Files.walkFileTree(Files.java:2706) ~[?:1.8.0_392]
I tried to test the same folder using attrib command (https://home.csulb.edu/~murdock/attrib.html#:~:text=Using%20the%20ATTRIB%20command%2C%20you,to%20as%20read%2Fwrite).) to list the files but I am getting the same error.
My guess is that this is buffer shortage in Windows API (~24K limit?)
Is there any way I can solve this using java.nio lib or some other alternative?