I have created a VFS using JIMFS.
FileSystem virtualFS = Jimfs.newFileSystem(Configuration.unix());
Path virtualPath = virtualFS.getPath("resources/virtualFolder");
Files.createDirectories(virtualPath);
Path refData = virtualPath.resolve("refData.csv");
System.out.println(refData);
Files.write(refData, ImmutableList.of(sData),StandardCharsets.UTF_8);
I am trying to read the file (refData.csv) in another method (Path is passed to the other method).
What I have tried until now are :
1: new FileDataModel(new FileInputStream(Files.lines(refData)));
2: new FileDataModel((File) Files.lines(refData));
3: new FileDataModel(new File(refData));
Unfortunately, none of these work as of now. I understand, I am mixing the default FS with the Virtual FS.
Error: Exception in thread "main" java.lang.UnsupportedOperationException
How to access the file created?.