Package com.github.stephenc.javaisotools.iso9660

Examples of com.github.stephenc.javaisotools.iso9660.ISO9660Directory


        // Directory hierarchy, starting from the root
        ISO9660RootDirectory.MOVED_DIRECTORIES_STORE_NAME = "rr_moved";
        ISO9660RootDirectory root = new ISO9660RootDirectory();

        ISO9660Directory dir = root.addDirectory("root");
        dir.addFile(contentsA);
        dir.addFile(contentsB);

        StreamHandler streamHandler = new ISOImageFileHandler(outfile);
        CreateISO iso = new CreateISO(streamHandler, root);
        ISO9660Config iso9660Config = new ISO9660Config();
        iso9660Config.allowASCII(false);
View Full Code Here


        IOUtil.copy("Goodbye", os);
        IOUtil.close(os);

        // Top down
        ISO9660RootDirectory root = new ISO9660RootDirectory();
        ISO9660Directory n1 = root.addDirectory("D1");
        ISO9660Directory n2 = n1.addDirectory("D2");
        ISO9660Directory n3 = n2.addDirectory("D3");
        n3.addFile(contentsA);
        n3.addFile(contentsB);

        StreamHandler streamHandler = new ISOImageFileHandler(outfile);
        CreateISO iso = new CreateISO(streamHandler, root);
        ISO9660Config iso9660Config = new ISO9660Config();
        iso9660Config.allowASCII(false);
View Full Code Here

        os = new FileOutputStream(contentsB);
        IOUtil.copy("Goodbye", os);
        IOUtil.close(os);

        // Bottom up
        ISO9660Directory n3 = new ISO9660Directory("D3");
        n3.addFile(contentsA);
        n3.addFile(contentsB);
        ISO9660Directory n2 = new ISO9660Directory("D2");
        n2.addDirectory(n3);
        ISO9660Directory n1 = new ISO9660Directory("D1");
        n1.addDirectory(n2);
        ISO9660RootDirectory root = new ISO9660RootDirectory();
        root.addDirectory(n1);

        StreamHandler streamHandler = new ISOImageFileHandler(outfile);
        CreateISO iso = new CreateISO(streamHandler, root);
View Full Code Here

        // Since rripRoot and isoRoot are just a deep copy of the same
        // root at this point, simultaneous iteration can be applied here
        Iterator isoIt = isoRoot.unsortedIterator();
        Iterator rripIt = rripRoot.unsortedIterator();
        while (isoIt.hasNext()) {
            ISO9660Directory isoDir = (ISO9660Directory) isoIt.next();
            ISO9660Directory rripDir = (ISO9660Directory) rripIt.next();
            directoryMapper.put(isoDir.getID(), rripDir);

            isoFit = isoDir.getFiles().iterator();
            rripFit = rripDir.getFiles().iterator();
            while (isoFit.hasNext()) {
                ISO9660File isoFile = (ISO9660File) isoFit.next();
                ISO9660File rripFile = (ISO9660File) rripFit.next();
                fileMapper.put(isoFile.getID(), rripFile);
            }
View Full Code Here

        if (dir == dir.getRoot().getMovedDirectoriesStore()) {
            return rripRoot.getMovedDirectoriesStore();
        }

        ISO9660Directory rripDir = (ISO9660Directory) directoryMapper.get(dir.getID());
        if (rripDir != null) {
            return rripDir;
        }

        throw new RuntimeException("No matching directory found for " + dir.getISOPath());
View Full Code Here

        NamingConventions namingConventions = helper.getNamingConventions();
        namingConventions.processDirectory(root);

        Iterator dit = root.unsortedIterator();
        while (dit.hasNext()) {
            ISO9660Directory dir = (ISO9660Directory) dit.next();
            namingConventions.processDirectory(dir);
        }
    }
View Full Code Here

    }

    private void relocateDirectories(ISO9660Directory dir) {
        Iterator it = dir.sortedIterator();
        while (it.hasNext()) {
            ISO9660Directory subdir = (ISO9660Directory) it.next();
            if (subdir.getLevel() == 9) {
                relocate(subdir);
            }
        }
    }
View Full Code Here

        } else {
            throw new HandlerException("Unknown Path Table Type: " + type);
        }

        HashMap parentMapper = new HashMap();
        ISO9660Directory dir = root;
        int dirNumber = 1;

        // Root Directory
        ISO9660PathTableRecord rptr = new ISO9660PathTableRecord(streamHandler, type, ISO9660Constants.FI_ROOT, 1);
        ptFixups.put(root, rptr.doPTR());
        parentMapper.put(dir, new Integer(dirNumber));

        // Subdirectories
        Iterator it = root.sortedIterator();
        while (it.hasNext()) {
            dirNumber++;
            dir = (ISO9660Directory) it.next();

            // Retrieve parent directory number and reset filename clash detection if appropriate
            int parent = ((Integer) parentMapper.get(dir.getParentDirectory())).intValue();

            DataReference ref = helper.getFilenameDataReference(dir);
            ISO9660PathTableRecord ptr = new ISO9660PathTableRecord(streamHandler, type, ref, parent);
            ptFixups.put(dir, ptr.doPTR());
            parentMapper.put(dir, new Integer(dirNumber));
View Full Code Here

        // Root Directory
        doDir(root, parentMapper);
        doRootDirFixups(parentMapper);

        // Subdirectories
        ISO9660Directory dir = root;
        Iterator it = root.sortedIterator();
        while (it.hasNext()) {
            dir = (ISO9660Directory) it.next();
            doDir(dir, parentMapper);
        }
View Full Code Here

        Iterator it = contents.iterator();
        while (it.hasNext()) {
            doBlockCheck(position);
            Object object = it.next();
            if (object instanceof ISO9660Directory) {
                ISO9660Directory subdir = (ISO9660Directory) object;
                if (subdir.isMoved() && dir != root.getMovedDirectoriesStore()) {
                    doDRLengthFixup(doFakeDR(subdir));
                } else {
                    doDRLengthFixup(doDR(subdir));
                }
            } else if (object instanceof ISO9660File) {
View Full Code Here

TOP

Related Classes of com.github.stephenc.javaisotools.iso9660.ISO9660Directory

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.