Package org.jnode.apps.vmware.disk.handler

Examples of org.jnode.apps.vmware.disk.handler.FileDescriptor


    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


            for (String decl : extentDecls) {
                ExtentDeclaration extentDecl = readExtentDeclaration(decl, file);
                if (extentDecl.isMainExtent()) {
                    mainExtentDecl = extentDecl;
                } else {
                    FileDescriptor fileDescriptor =
                            IOUtils.readFileDescriptor(extentDecl.getExtentFile());

                    Extent extent = createExtent(fileDescriptor, extentDecl);
                    extents.add(extent);
                }
View Full Code Here

     * @throws IOException
     * @throws UnsupportedFormatException
     */
    public static FileDescriptor readFileDescriptor(File file)
        throws IOException, UnsupportedFormatException {
        FileDescriptor fileDescriptor = null;

        for (ExtentFactory f : FACTORIES) {
            try {
                LOG.debug("trying with factory " + f.getClass().getName());
                FileDescriptor fd = f.createFileDescriptor(file);

                // we have found the factory for that format
                fileDescriptor = fd;

                break;
View Full Code Here

     * @param file
     * @throws IOException
     * @throws UnsupportedFormatException
     */
    public VMWareDisk(File file) throws IOException, UnsupportedFormatException {
        FileDescriptor fd = IOUtils.readFileDescriptor(file);

        ExtentFactory factory = fd.getExtentFactory();

        this.handler = factory.createIOHandler(fd);
        this.descriptor = fd.getDescriptor();

        this.length = handler.getNbSectors() * IOHandler.SECTOR_SIZE;
        LOG.debug("handler for file " + file.getName() + " : " + handler.getClass().getName());
    }
View Full Code Here

TOP

Related Classes of org.jnode.apps.vmware.disk.handler.FileDescriptor

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.