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

Examples of org.jnode.net.nfs.nfs2.mount.Mount1Client$Result


  {
    if (this.dispReport==null) {
      this.dispReport = this.objectFactory.createDispositionReport();
    }

    Result jaxbResult = this.objectFactory.createResult();
    this.dispReport.getResult().add(jaxbResult);
   
    if (result.getErrInfo() != null) jaxbResult.setErrInfo(result.getErrInfo());
    if (result.getKeyType() != null) jaxbResult.setKeyType(result.getKeyType());
    jaxbResult.setErrno(result.getErrno());
  }
View Full Code Here


            keyResultArr = new Result[resultList.size()];
            resultList.toArray(keyResultArr);
           
            log.debug("After deleting Business. Obtained vector size:" + keyResultArr != null ? keyResultArr.length : 0);
            for (int i = 0; keyResultArr != null && i < keyResultArr.length; i++) {
                Result result = (Result) keyResultArr[i];
                int errno = result.getErrno();
                if (errno == 0) {
                    coll.addAll(keys);
                }
                else {
                    ErrInfo errinfo = result.getErrInfo();
                    DeleteException de = new DeleteException(errinfo.getErrCode() + ":" + errinfo.getValue());
                    bulk.setStatus(JAXRResponse.STATUS_FAILURE);
                    exceptions.add(de);
                }
            }
View Full Code Here

    public FSEntry addDirectory(String name) throws IOException {

        NFS2Client nfsClient = getNFS2Client();

        CreateDirectoryResult result;
        try {
            result = nfsClient.createDirectory(directoryEntry.getFileHandle(), name,
                DEFAULT_PERMISSION, -1, -1, -1, new Time(-1, -1), new Time(-1, -1));
        } catch (NFS2Exception e) {
            throw new IOException("Can not create the directory " + name + "." + e.getMessage(), e);
        }

        NFS2Entry entry =
            new NFS2Entry((NFS2FileSystem) getFileSystem(), this, name, result.getFileHandle(),
                result.getFileAttribute());
        tableEntry.addEntry(entry);
        return entry;
    }
View Full Code Here

    }

    public FSEntry addFile(String name) throws IOException {
        NFS2Client nfsClient = getNFS2Client();

        CreateFileResult result;
        try {
            result = nfsClient.createFile(directoryEntry.getFileHandle(), name, DEFAULT_PERMISSION,
                -1, -1, -1, new Time(-1, -1), new Time(-1, -1));
        } catch (NFS2Exception e) {
            throw new IOException("Can not create the file " + name + "." + e.getMessage(), e);
        }

        NFS2Entry entry =
            new NFS2Entry((NFS2FileSystem) getFileSystem(), this, name, result.getFileHandle(),
                result.getFileAttribute());

        tableEntry.addEntry(entry);

        return entry;
    }
View Full Code Here

                } else {
                    throw new IOException("The path contains an unknow resource: " + t +
                            ". It is not directory or file");
                }
            }
            CreateFileResult result =
                    nfsClient.createFile(tempFileHandle, tokenList.get(tokenList.size() - 1),
                            DEFAULT_PERMISSION, uid, gid, 0, new Time(-1, -1), new Time(-1, -1));
            fileHandle = result.getFileHandle();
            fileAttribute = result.getFileAttribute();
        } catch (NFS2Exception e) {
            try {
                mountClient.unmount(mountDirectory);
            } catch (MountException e1) {
                // ignore
View Full Code Here

     * All elements returned by the iterator must be instanceof FSEntry.
     */
    public Iterator<? extends NFS2Entry> iterator() throws IOException {
        final NFS2Client nfsClient = getNFS2Client();

        @SuppressWarnings("unused")
        FileAttribute fileAttribute;
        try {
            fileAttribute =
                AccessController.doPrivileged(new PrivilegedExceptionAction<FileAttribute>() {
                    public FileAttribute run() throws Exception {
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 {
View Full Code Here

    public boolean isReadOnly() {
        return readOnly;
    }

    public long getFreeSpace() {
        FileSystemAttribute fileSystemAttribute = getFileSystemAttribute();
        return fileSystemAttribute.getBlockSize() * fileSystemAttribute.getFreeBlockCount();
    }
View Full Code Here

        FileSystemAttribute fileSystemAttribute = getFileSystemAttribute();
        return fileSystemAttribute.getBlockSize() * fileSystemAttribute.getFreeBlockCount();
    }

    public long getTotalSpace() {
        FileSystemAttribute fileSystemAttribute = getFileSystemAttribute();
        return fileSystemAttribute.getBlockSize() * fileSystemAttribute.getBlockCount();
    }
View Full Code Here

        FileSystemAttribute fileSystemAttribute = getFileSystemAttribute();
        return fileSystemAttribute.getBlockSize() * fileSystemAttribute.getBlockCount();
    }

    public long getUsableSpace() {
        FileSystemAttribute fileSystemAttribute = getFileSystemAttribute();
        return fileSystemAttribute.getBlockSize() * fileSystemAttribute.getFreeBlockCount();
    }
View Full Code Here

TOP

Related Classes of org.jnode.net.nfs.nfs2.mount.Mount1Client$Result

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.