Package org.jnode.apps.vmware.disk.descriptor

Examples of org.jnode.apps.vmware.disk.descriptor.Descriptor


    }

    @Override
    public Extent createExtent(FileDescriptor fileDescriptor, ExtentDeclaration extentDecl)
        throws IOException, UnsupportedFormatException {
        Descriptor desc = (fileDescriptor == null) ? null : fileDescriptor.getDescriptor();
        return createMainExtent(desc, extentDecl);
    }
View Full Code Here


*/
public class SimpleExtentFactory extends ExtentFactory {
    protected FileDescriptor createFileDescriptor(File file, RandomAccessFile raf)
        throws IOException, UnsupportedFormatException {
        // read 2 sectors, starting from sector number 0
        Descriptor descriptor = getDescriptorRW().read(file, 0, 2);

        return new FileDescriptor(descriptor, raf, this);
    }
View Full Code Here

     * @throws IOException
     */
    public SparseExtent read(FileChannel channel, SparseFileDescriptor fileDescriptor,
            ExtentDeclaration extentDecl) throws IOException {
        LOG.debug("fileDescriptor=" + fileDescriptor);
        Descriptor descriptor = fileDescriptor.getDescriptor();

        RandomAccessFile raf = fileDescriptor.getRandomAccessFile();
        SparseExtentHeader header = fileDescriptor.getHeader();

        IOUtils.positionSector(raf.getChannel(), header.getRgdOffset());
View Full Code Here

        File mainFile = new File(directory, createDiskFileName(name, 0));
        RandomAccessFile raf = new RandomAccessFile(mainFile, "rw");
        @SuppressWarnings("unused")
        FileChannel channel = raf.getChannel();

        @SuppressWarnings("unused")
        Descriptor descriptor = buildDescriptor(mainFile, size);
        @SuppressWarnings("unused")
        SparseExtentHeader header = new SparseExtentHeader();

        return mainFile;
View Full Code Here

        // build extents
        List<Extent> extents = new ArrayList<Extent>();
        SparseExtent mainExtent = createMainExtent(mainFile, nbSectors);
        extents.add(mainExtent);

        Descriptor descriptor = new Descriptor(mainFile, header, extents, ddb);
        mainExtent.setDescriptor(descriptor);
        return descriptor;
    }
View Full Code Here

        throws IOException, UnsupportedFormatException {
        ByteBuffer bb = IOUtils.getByteBuffer(raf, 1024);

        SparseExtentHeaderRW reader = new SparseExtentHeaderRW();
        SparseExtentHeader header = reader.read(bb);
        Descriptor embeddedDescriptor;
        if (header.getDescriptorOffset() != 0) {
            embeddedDescriptor =
                    getDescriptorRW().read(file, (int) header.getDescriptorOffset(),
                            (int) header.getDescriptorSize());

            DiskDatabase ddb = embeddedDescriptor.getDiskDatabase();
            long nbSectors = ddb.getCylinders() * ddb.getHeads() * ddb.getSectors();
            LOG.debug("createFileDescriptor: capacity=" + header.getCapacity() + " nbSectors=" +
                    nbSectors);
        } else {
            LOG.debug("embeddedDescriptor = null");
View Full Code Here

     */
    public SparseIOHandler createIOHandler(FileDescriptor fileDescriptor) throws IOException {
        SparseFileDescriptor sfd = (SparseFileDescriptor) fileDescriptor;
        SparseIOHandler handler = null;

        Descriptor desc = sfd.getDescriptor();
        handler = new SparseIOHandler(desc);

        return handler;
    }
View Full Code Here

TOP

Related Classes of org.jnode.apps.vmware.disk.descriptor.Descriptor

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.