Package org.jnode.net.nfs.nfs2.mount

Examples of org.jnode.net.nfs.nfs2.mount.MountResult


        List<ExportEntry> exportEntryList;
        try {
            exportEntryList = AccessController.doPrivileged(
                    new PrivilegedExceptionAction<List<ExportEntry>>() {
                        public List<ExportEntry> run() throws IOException, MountException {
                            Mount1Client client =
                                new Mount1Client(host, Protocol.TCP, -1, -1);
                            List<ExportEntry> exportEntryList;
                            try {
                                exportEntryList = client.export();
                            } finally {
                                if (client != null) {
                                    try {
                                        client.close();
                                    } catch (IOException e) {
                                        // squash
                                    }
                                }
                            }
View Full Code Here


            }
        } else {
            throw new IOException("The url doesn't contains the uid and guid.");
        }

        mountClient = new Mount1Client(InetAddress.getByName(url.getHost()), Protocol.TCP, uid, gid);
        nfsClient = new NFS2Client(InetAddress.getByName(url.getHost()), Protocol.TCP, uid, gid);
        String path = url.getPath();
        List<ExportEntry> exportList;
        try {
            exportList = mountClient.export();
View Full Code Here

    private FileAttribute fileAttribute;

    public NFS2InputStream(URL url) throws IOException {
        // FIXME ... exception handling in this method should be reviewed.  At the very least,
        // there are places where finally clauses should be used.
        mountClient = new Mount1Client(InetAddress.getByName(url.getHost()), Protocol.TCP, -1, -1);
        nfsClient = new NFS2Client(InetAddress.getByName(url.getHost()), Protocol.TCP, -1, -1);
        String path = url.getPath();
        List<ExportEntry> exportList;
        try {
            exportList = mountClient.export();
View Full Code Here

        mountClient = new Mount1Client(device.getHost(), device.getProtocol(), device.getUid(), device.getGid());
        nfsClient = new NFS2Client(device.getHost(), device.getProtocol(), device.getUid(), device.getGid());

        // Mount the file system
        MountResult result;
        FileAttribute fileAttribute;
        try {
            result = mountClient.mount(device.getRemoteDirectory());
            fileAttribute = nfsClient.getAttribute(result.getFileHandle());
        } catch (IOException e) {
            try {
                close();
            } catch (IOException e1) {
                // ignore
            }
            throw new FileSystemException(e.getMessage(), e);
        } catch (MountException e) {
            try {
                close();
            } catch (IOException e1) {
                // ignore
            }
            throw new FileSystemException(e.getMessage(), e);
        } catch (NFS2Exception e) {
            try {
                close();
            } catch (IOException e1) {
                // ignore
            }
            throw new FileSystemException(e.getMessage(), e);
        }
        root = new NFS2RootEntry(this, result.getFileHandle(), fileAttribute);
    }
View Full Code Here

        }
        if (exportEntry == null) {
            throw new IOException("The path " + path + " it is not exported");
        }
        mountDirectory = exportEntry.getDirectory();
        MountResult mountResult;
        try {
            mountResult = mountClient.mount(mountDirectory);
        } catch (MountException e) {
            mountClient.close();
            throw new IOException(e.getMessage());
        }

        byte[] tempFileHandle = mountResult.getFileHandle();
        try {
            String filePath = path.substring(exportEntry.getDirectory().length());
            StringTokenizer tokenizer = new StringTokenizer(filePath, "/");
            List<String> tokenList = new ArrayList<String>();
            while (tokenizer.hasMoreElements()) {
View Full Code Here

        if (exportEntry == null) {
            throw new IOException("The path " + path + " it is not exported");
        }
        mountDirectory = exportEntry.getDirectory();
        MountResult mountResult;
        try {
            mountResult = mountClient.mount(mountDirectory);
        } catch (MountException e) {
            try {
                mountClient.close();
            } catch (IOException e1) {
                // ignore
            }
            throw new IOException(e.getMessage());
        } catch (IOException e) {
            try {
                mountClient.close();
            } catch (IOException e1) {
                // ignore
            }
            throw e;
        }

        byte[] tempFileHandle = mountResult.getFileHandle();

        try {
            String filePath = path.substring(exportEntry.getDirectory().length());
            StringTokenizer tokenizer = new StringTokenizer(filePath, "/");
            while (tokenizer.hasMoreElements()) {
View Full Code Here

TOP

Related Classes of org.jnode.net.nfs.nfs2.mount.MountResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.