Created
February 2, 2015 20:36
Java NFS client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
测试了,重点在nfs路径中,服务器名称后需要两个 斜杠。