Package org.jnode.fs

Examples of org.jnode.fs.FileSystemException


            HfsPlusFileSystemType type = fss.getFileSystemType(HfsPlusFileSystemType.ID);
            HfsPlusFileSystem fs = new HfsPlusFileSystem(device, false, type);
            fs.create(params);
            return fs;
        } catch (NameNotFoundException e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here


        this.fs = fs;

        // check the magic :)
        if (getMagic() != 0xEF53)
            throw new FileSystemException("Not ext2 superblock (" + getMagic() + ": bad magic)");

        setDirty(false);
    }
View Full Code Here

            setReadOnly(true);
        }
        try {
            extentOverflow = new Extent(this);
        } catch (IOException e) {
            throw new FileSystemException(e);
        }
        try {
            catalog = new Catalog(this);
        } catch (IOException e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here

            extentOverflow = new Extent(params);
            log.debug("Write volume header to disk.");
            volumeHeader.update();
            flush();
        } catch (IOException e) {
            throw new FileSystemException("Unable to create HFS+ filesystem", e);
        }
    }
View Full Code Here

    private int preallocCount;

    public synchronized long usePreallocBlock() throws FileSystemException {
        if (preallocCount <= 0) {
            throw new FileSystemException("No preallocated blocks");
        }
        --preallocCount;
        return preallocBlock++;
    }
View Full Code Here

            Ext2FileSystemType type = fSS.getFileSystemType(Ext2FileSystemType.ID);
            Ext2FileSystem fs = new Ext2FileSystem(device, false, type);
            fs.create(blockSize);
            return fs;
        } catch (NameNotFoundException e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here

            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

            }

        } catch (FileSystemException e) {
            throw e;
        } catch (Exception e) {
            throw new FileSystemException(e);
        }

        // check for unsupported filesystem options
        // (an unsupported INCOMPAT feature means that the fs may not be mounted
        // at all)
        if (hasIncompatFeature(Ext2Constants.EXT2_FEATURE_INCOMPAT_COMPRESSION)) throw new FileSystemException(
            getDevice().getId() + " Unsupported filesystem feature (COMPRESSION) disallows mounting");
        if (hasIncompatFeature(Ext2Constants.EXT2_FEATURE_INCOMPAT_META_BG)) throw new FileSystemException(
            getDevice().getId() + " Unsupported filesystem feature (META_BG) disallows mounting");
        if (hasIncompatFeature(Ext2Constants.EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) throw new FileSystemException(
            getDevice().getId() + " Unsupported filesystem feature (JOURNAL_DEV) disallows mounting");
        // if (hasIncompatFeature(Ext2Constants.EXT3_FEATURE_INCOMPAT_RECOVER))
        // throw new FileSystemException(getDevice().getId() +
        // " Unsupported filesystem feature (RECOVER) disallows mounting");
        // if (hasIncompatFeature(Ext2Constants.EXT4_FEATURE_INCOMPAT_EXTENTS))
        // throw new FileSystemException(getDevice().getId() +
        // " Unsupported filesystem feature (EXTENTS) disallows mounting");
        if (hasIncompatFeature(Ext2Constants.EXT4_FEATURE_INCOMPAT_64BIT)) throw new FileSystemException(
            getDevice().getId() + " Unsupported filesystem feature (64BIT) disallows mounting");
        if (hasIncompatFeature(Ext2Constants.EXT4_FEATURE_INCOMPAT_MMP)) throw new FileSystemException(
            getDevice().getId() + " Unsupported filesystem feature (MMP) disallows mounting");
        if (hasIncompatFeature(Ext2Constants.EXT4_FEATURE_INCOMPAT_FLEX_BG)) throw new FileSystemException(
            getDevice().getId() + " Unsupported filesystem feature (FLEX_BG) disallows mounting");

        // an unsupported RO_COMPAT feature means that the filesystem can only
        // be mounted readonly
        if (hasROFeature(Ext2Constants.EXT2_FEATURE_RO_COMPAT_LARGE_FILE)) {
View Full Code Here

            // write everything to disk
            flush();

        } catch (IOException ioe) {
            throw new FileSystemException("Unable to create filesystem", ioe);
        }

    }
View Full Code Here

     * Return the inode numbered inodeNr (the first inode is #1) Synchronized access to the inodeCache is important as
     * the file/directory operations are synchronized to the inodes, so at any point in time it has to be sure that only
     * one instance of any inode is present in the filesystem.
     */
    public INode getINode(int iNodeNr) throws IOException, FileSystemException {
        if ((iNodeNr < 1) || (iNodeNr > superblock.getINodesCount())) throw new FileSystemException("INode number ("
            + iNodeNr + ") out of range (0-" + superblock.getINodesCount() + ")");

        Integer key = Integer.valueOf(iNodeNr);

        log.debug("iNodeCache size: " + inodeCache.size());
View Full Code Here

TOP

Related Classes of org.jnode.fs.FileSystemException

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.