Package org.jnode.fs

Examples of org.jnode.fs.FileSystemException


            final FileSystemService fSS = InitialNaming.lookup(FileSystemService.NAME);
            FatFileSystemType type = fSS.getFileSystemType(FatFileSystemType.ID);
            return new FatFileSystem(device, false, type); // not readOnly !
        } catch (IOException ioe) {
            throw new FileSystemException("Formating problem", ioe);
        } catch (ApiNotFoundException e) {
            throw new FileSystemException("Formating problem", e);
        } catch (NameNotFoundException e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here


            } finally {
                // fd.stop();
                fd.close();
            }
        } catch (NameNotFoundException e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here

            fat = fats[0];
            rootDir.read(getApi(), FatUtils.getRootDirOffset(bs));
            rootEntry = new FatRootEntry(rootDir);
            // files = new FatFile[fat.getNrEntries()];
        } catch (IOException ex) {
            throw new FileSystemException(ex);
        } catch (Exception e) { // something bad happened in the FAT boot
            // sector... just ignore this FS
            throw new FileSystemException(e);
        }
    }
View Full Code Here

    public <T extends FileSystemType<?>> T getFileSystemType(Class<T> name)
        throws FileSystemException {
        T result = fsTypeManager.getSystemType(name);
        if (result == null) {
            throw new FileSystemException("FileSystemType " + name + " doesn't exist");
        }
        return result;
    }
View Full Code Here

                ByteBuffer b = ByteBuffer.allocate(SUPERBLOCK_LENGTH);
                fs.getApi().read(1024, b);
                data = new byte[SUPERBLOCK_LENGTH];
                System.arraycopy(b.array(), 0, data, 0, SUPERBLOCK_LENGTH);
                if (getMagic() != HFSPLUS_SUPER_MAGIC && getMagic() != HFSX_SUPER_MAGIC) {
                    throw new FileSystemException("Not hfs+ volume header (" + getMagic() +
                        ": bad magic)");
                }

            }
        } catch (IOException e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here

            return new Fat16(bs, api);
        } else if (bs.isFat12()) {
            return new Fat12(bs, api);
        }

        throw new FileSystemException("FAT not recognized");
    }
View Full Code Here

            final RootDirVisitor rootDirVis = new RootDirVisitor(sb);

            DirectoryParser.create(rootNode).parse(rootDirVis);

            if (rootDirVis.bitmap == null) {
                throw new FileSystemException("cluster bitmap not found");
            }

            if (rootDirVis.upcase == null) {
                throw new FileSystemException("upcase table not found");
            }

            this.upcase = rootDirVis.upcase;
            this.bitmap = rootDirVis.bitmap;
            this.label = rootDirVis.label;

        } catch (Exception e) {
            throw new FileSystemException(e);
        }
    }
View Full Code Here

     * @throws FileSystemException device is null or device has no {@link BlockDeviceAPI} defined.
     */
    public AbstractFileSystem(Device device, boolean readOnly,
            FileSystemType<? extends FileSystem<T>> type) throws FileSystemException {
        if (device == null)
            throw new FileSystemException("Device cannot be null.");

        this.device = device;

        try {
            api = device.getAPI(BlockDeviceAPI.class);
        } catch (ApiNotFoundException e) {
            throw new FileSystemException("Device is not a partition!", e);
        }

        this.closed = false;
        this.readOnly = readOnly;
        this.type = type;
View Full Code Here

        byte mask = (byte) ~(1 << bitIndex);

        // filesystem consistency check
        if (DEBUG) {
            if (isFree(data[byteIndex], bitIndex))
                throw new FileSystemException("FS consistency error: you are trying "
                        + "to free an unallocated block/inode");
        }

        data[byteIndex] = (byte) (data[byteIndex] & mask);
    }
View Full Code Here

    /**
     * Constructor for JIFileSystem in specified readOnly mode
     */
    public JIFileSystem(Device device, boolean readOnly, JIFileSystemType type) throws FileSystemException {
        if (readOnly == false) {
            throw new FileSystemException("JIFS can not be created as writable...");
        }
        this.device = device;
        this.type = type;
        rootDir = new JIFSDrootDir(device.getId());
    }
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.