'How to access Files Locally using JCIFS?

Currently its my windows machine. I am able to access files using shared network but when I try using local path it does not work. I want my code to work with local path like if my code is deployed in LINUX or windows I should be able to access files with local path and not shared network path.

NtlmPasswordAuthenticator sourceAuth = new NtlmPasswordAuthenticator("DOMAIN",
                "USERNAME", "PASSWORD");
Properties properties = new Properties();
properties.setProperty("jcifs.smb.client.responseTimeout", "5000");
PropertyConfiguration configuration = new PropertyConfiguration(properties);
CIFSContext cifsContext = new BaseContext(configuration).withCredentials(sourceAuth);

SmbFile sourceDir = new SmbFile  (localSourceUrl,cifsContext);

localSourceUrl = smb://IPAddress/MYFOLDER works but
localSourceUrl = smb://IPAddress/C/MYFOLDER does not work

Error is jcifs.smb.SmbException: The network name cannot be found.



Solution 1:[1]

localSourceUrl = smb://IPAddress/C/MYFOLDER does not work as it is not shared so will not work It does not show up when listing shares on pc

smb://IPAddress/MYFOLDER will work as MYFOLDER will show as it is shared

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Theo