PPT Slide
Example #4 - Using URL Interface
fileURL = new URL("nfs://www.sun.com/index.html");
// open connection to URL
NetFileURLConnection nfuc = (NetFileURLConnection) fileURL.openConnection();
// get an input stream for the URL
FileInputStream nfis = fileURL.getInputStream();
for ( int count =0; ; count++ ) {
int val = (byte) nfis.read();
System.out.println("read " + count + " bytes ");
// note that you can get access to the FileAccessor from the NFAURLConnection
// get file system / protocol specific interface from factory
NFSFileAccessor nfa = nfuc.getFileAccessor();
// use interface to get file system /protocol specific information
System.out.println("File GID is " + nfa.getGID());
System.out.println("File UID is " + nfa.getUID());