Skip to content

Instantly share code, notes, and snippets.

@krujos
Created February 2, 2015 20:36
Show Gist options
  • Save krujos/57e760968d2fd5fb2dbe to your computer and use it in GitHub Desktop.
Save krujos/57e760968d2fd5fb2dbe to your computer and use it in GitHub Desktop.
Java NFS client
package nfstest;
import com.sun.xfile.XFile;
/**
* Using YANFS
*
*/
public class Main {
public static void main(String args[]) {
try {
XFile xf = new XFile("nfs://10.0.1.7//Users/test.txt");
if (xf.canRead())
System.out.println("Read permission OK");
else
System.out.println("No Read permission");
} catch (Exception e) {
System.out.println(e);
}
}
}
@cnzzr
Copy link

cnzzr commented May 15, 2015

测试了,重点在nfs路径中,服务器名称后需要两个 斜杠。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment