简体   繁体   中英

Reading contents shared on Windows machine from Unix Box with a Java Program

I have shared contents on windows machine say \\someip\\somedirectory and now I want to write a program in Java that runs on Unix Box and reads contents of the shared folder.

File file=new File(directoryPath);
if(file.isDirectory()) returns false.

Therefore I am failing on the first step itself. Please suggest how can I do that.

You should use return instead of returns :

File file=new File(directoryPath);
if(file.isDirectory()) return false;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM