Package org.jnode.driver.block

Examples of org.jnode.driver.block.FileDevice


    }

    @Test
    public void testReadSmallDisk() throws Exception {

        device = new FileDevice(FileSystemTestUtils.getTestFile("test/fs/ntfs/test.ntfs"), "r");
        NTFSFileSystemType type = fss.getFileSystemType(NTFSFileSystemType.ID);
        NTFSFileSystem fs = type.create(device, true);

        String expectedStructure =
            "type: NTFS vol: total:104857600 free:102283264\n" +
View Full Code Here


    @Test
    @Ignore
    public void testReadCompressedDisk() throws Exception {

        device = new FileDevice(FileSystemTestUtils.getTestFile("test/fs/ntfs/compressed.dd"), "r");
        NTFSFileSystemType type = fss.getFileSystemType(NTFSFileSystemType.ID);
        NTFSFileSystem fs = type.create(device, true);

        String expectedStructure =
            "type: NTFS vol:COMPRESS total:26214400 free:15031296\n" +
View Full Code Here

    }

    @Test
    public void testReadFat32Disk() throws Exception {

        device = new FileDevice(FileSystemTestUtils.getTestFile("test/fs/jfat/test.fat32"), "r");
        FatFileSystemType type = fss.getFileSystemType(FatFileSystemType.ID);
        FatFileSystem fs = type.create(device, true);

        String expectedStructure =
            "type: JFAT vol: total:-1 free:-1\n" +
View Full Code Here

    }

    @Test
    public void testReadFat16Disk() throws Exception {

        device = new FileDevice(FileSystemTestUtils.getTestFile("jfat/test.fat16"), "r");
        FatFileSystemType type = fss.getFileSystemType(FatFileSystemType.ID);
        FatFileSystem fs = type.create(device, true);

        String expectedStructure =
            "type: JFAT vol: total:-1 free:-1\n" +
View Full Code Here

     * @throws FileSystemException
     */
    public void createImage() throws IOException, DriverException,
        FileSystemException {

        final FileDevice newFd = new FileDevice(destFile, "rw");
        try {
            newFd.setLength(getDeviceLength());
            formatDevice(newFd);
            final Device sysDev = getSystemDevice(newFd);
            final BlockDeviceAPI sysDevApi = sysDev
                .getAPI(BlockDeviceAPI.class);
            copySystemFiles(sysDev);
            sysDevApi.flush();
        } catch (ApiNotFoundException ex) {
            final IOException ioe = new IOException("BlockDeviceAPI not found on device");
            ioe.initCause(ex);
            throw ioe;
        } finally {
            newFd.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.block.FileDevice

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.