Examples of ChmDirectoryListingSet


Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

                    ChmCommons.copyOfRange(getData(), (int) getChmItsfHeader()
                            .getDirOffset(), (int) getChmItsfHeader().getDirOffset() +
                            ChmConstants.CHM_ITSP_V1_LEN), getChmItspHeader());

            /* Creates instance of ChmDirListingContainer */
            setChmDirList(new ChmDirectoryListingSet(getData(),
                    getChmItsfHeader(), getChmItspHeader()));

            int indexOfControlData = getChmDirList().getControlDataIndex();
            int indexOfResetData = ChmCommons.indexOfResetTableBlock(getData(),
                    ChmConstants.LZXC.getBytes());
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

        chmItspHeader.parse(ChmCommons.copyOfRange(data,
                (int) chmItsHeader.getDirOffset(),
                (int) chmItsHeader.getDirOffset()
                        + ChmConstants.CHM_ITSP_V1_LEN), chmItspHeader);
        /* Creating instance of ChmDirListingContainer */
        ChmDirectoryListingSet chmDirListCont = new ChmDirectoryListingSet(
                data, chmItsHeader, chmItspHeader);
        int indexOfControlData = chmDirListCont.getControlDataIndex();

        int indexOfResetTable = ChmCommons.indexOfResetTableBlock(data,
                ChmConstants.LZXC.getBytes());
        byte[] dir_chunk = null;
        if (indexOfResetTable > 0) {
            // dir_chunk = Arrays.copyOfRange( data, indexOfResetTable,
            // indexOfResetTable
            // +
            // chmDirListCont.getDirectoryListingEntryList().get(indexOfControlData).getLength());
            dir_chunk = ChmCommons.copyOfRange(data, indexOfResetTable,
                    indexOfResetTable
                            + chmDirListCont.getDirectoryListingEntryList()
                                    .get(indexOfControlData).getLength());
        }

        /* Creates and parses control block */
        chmLzxcControlData = new ChmLzxcControlData();
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

        chmItspHeader.parse(ChmCommons.copyOfRange(data,
                (int) chmItsHeader.getDirOffset(),
                (int) chmItsHeader.getDirOffset()
                        + ChmConstants.CHM_ITSP_V1_LEN), chmItspHeader);
        /* Creating instance of ChmDirListingContainer */
        chmDirListCont = new ChmDirectoryListingSet(data, chmItsHeader,
                chmItspHeader);
        int indexOfControlData = chmDirListCont.getControlDataIndex();

        int indexOfResetTable = ChmCommons.indexOfResetTableBlock(data,
                ChmConstants.LZXC.getBytes());
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

        chmItspHeader.parse(ChmCommons.copyOfRange(data,
                (int) chmItsfHeader.getDirOffset(),
                (int) chmItsfHeader.getDirOffset()
                        + ChmConstants.CHM_ITSP_V1_LEN), chmItspHeader);
        /* Creating instance of ChmDirListingContainer */
        ChmDirectoryListingSet chmDirListCont = new ChmDirectoryListingSet(
                data, chmItsfHeader, chmItspHeader);
        int indexOfControlData = chmDirListCont.getControlDataIndex();

        int indexOfResetTable = ChmCommons.indexOfResetTableBlock(data,
                ChmConstants.LZXC.getBytes());
        byte[] dir_chunk = null;
        if (indexOfResetTable > 0) {
            // dir_chunk = Arrays.copyOfRange( data, indexOfResetTable,
            // indexOfResetTable
            // +
            // chmDirListCont.getDirectoryListingEntryList().get(indexOfControlData).getLength());
            dir_chunk = ChmCommons.copyOfRange(data, indexOfResetTable,
                    indexOfResetTable
                            + chmDirListCont.getDirectoryListingEntryList()
                                    .get(indexOfControlData).getLength());
        }

        /* Creates and parses control block */
        ChmLzxcControlData chmLzxcControlData = new ChmLzxcControlData();
        chmLzxcControlData.parse(dir_chunk, chmLzxcControlData);

        indexOfResetTable = chmDirListCont.getResetTableIndex();
        chmLzxcResetTable = new ChmLzxcResetTable();

        int startIndex = (int) chmDirListCont.getDataOffset()
                + chmDirListCont.getDirectoryListingEntryList()
                        .get(indexOfResetTable).getOffset();

        ChmAssert.assertCopyingDataIndex(startIndex, data.length);

        // dir_chunk = Arrays.copyOfRange(data, startIndex, startIndex
        // +
        // chmDirListCont.getDirectoryListingEntryList().get(indexOfResetTable).getLength());
        dir_chunk = ChmCommons.copyOfRange(
                data,
                startIndex,
                startIndex
                        + chmDirListCont.getDirectoryListingEntryList()
                                .get(indexOfResetTable).getLength());

        chmLzxcResetTable.parse(dir_chunk, chmLzxcResetTable);
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

        assertNotNull(chmExtractor.getChmDirList());
    }

    @Test
    public void testExtractChmEntry() throws TikaException{
        ChmDirectoryListingSet entries = chmExtractor.getChmDirList();
        int count = 0;
        for (Iterator<DirectoryListingEntry> it = entries
                .getDirectoryListingEntryList().iterator(); it.hasNext();) {
            chmExtractor.extractChmEntry(it.next());
            ++count;
        }
        assertEquals(TestParameters.VP_CHM_ENTITIES_NUMBER, count);
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

                (int) chmItsHeader.getDirOffset(),
                (int) chmItsHeader.getDirOffset()
                + ChmConstants.CHM_ITSP_V1_LEN), chmItspHeader);

        /* Creating instance of ChmDirListingContainer */
        ChmDirectoryListingSet chmDirListCont = new ChmDirectoryListingSet(
                data, chmItsHeader, chmItspHeader);
        int indexOfControlData = ChmCommons.indexOf(
                chmDirListCont.getDirectoryListingEntryList(),
                ChmConstants.CONTROL_DATA);

        int indexOfResetTable = ChmCommons.indexOfResetTableBlock(data,
                ChmConstants.LZXC.getBytes());
        byte[] dir_chunk = null;
        if (indexOfResetTable > 0) {
            // dir_chunk = Arrays.copyOfRange( data, indexOfResetTable,
            // indexOfResetTable
            // +
            // chmDirListCont.getDirectoryListingEntryList().get(indexOfControlData).getLength());
            dir_chunk = ChmCommons.copyOfRange(data, indexOfResetTable,
                    indexOfResetTable
                    + chmDirListCont.getDirectoryListingEntryList()
                    .get(indexOfControlData).getLength());
        }

        ChmLzxcControlData clcd = new ChmLzxcControlData();
        clcd.parse(dir_chunk, clcd);
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

                    ChmCommons.copyOfRange(getData(), (int) getChmItsfHeader()
                            .getDirOffset(), (int) getChmItsfHeader().getDirOffset() +
                            ChmConstants.CHM_ITSP_V1_LEN), getChmItspHeader());

            /* Creates instance of ChmDirListingContainer */
            setChmDirList(new ChmDirectoryListingSet(getData(),
                    getChmItsfHeader(), getChmItspHeader()));

            int indexOfControlData = getChmDirList().getControlDataIndex();
            int indexOfResetData = ChmCommons.indexOfResetTableBlock(getData(),
                    ChmConstants.LZXC.getBytes());
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

        chmItspHeader.parse(ChmCommons.copyOfRange(data,
                (int) chmItsHeader.getDirOffset(),
                (int) chmItsHeader.getDirOffset()
                        + ChmConstants.CHM_ITSP_V1_LEN), chmItspHeader);
        /* Creating instance of ChmDirListingContainer */
        chmDirListCont = new ChmDirectoryListingSet(data, chmItsHeader,
                chmItspHeader);
        int indexOfControlData = chmDirListCont.getControlDataIndex();

        int indexOfResetTable = ChmCommons.indexOfResetTableBlock(data,
                ChmConstants.LZXC.getBytes());
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

        chmItspHeader.parse(ChmCommons.copyOfRange(data,
                (int) chmItsfHeader.getDirOffset(),
                (int) chmItsfHeader.getDirOffset()
                        + ChmConstants.CHM_ITSP_V1_LEN), chmItspHeader);
        /* Creating instance of ChmDirListingContainer */
        ChmDirectoryListingSet chmDirListCont = new ChmDirectoryListingSet(
                data, chmItsfHeader, chmItspHeader);
        int indexOfControlData = chmDirListCont.getControlDataIndex();

        int indexOfResetTable = ChmCommons.indexOfResetTableBlock(data,
                ChmConstants.LZXC.getBytes());
        byte[] dir_chunk = null;
        if (indexOfResetTable > 0) {
            // dir_chunk = Arrays.copyOfRange( data, indexOfResetTable,
            // indexOfResetTable
            // +
            // chmDirListCont.getDirectoryListingEntryList().get(indexOfControlData).getLength());
            dir_chunk = ChmCommons.copyOfRange(data, indexOfResetTable,
                    indexOfResetTable
                            + chmDirListCont.getDirectoryListingEntryList()
                                    .get(indexOfControlData).getLength());
        }

        /* Creates and parses control block */
        ChmLzxcControlData chmLzxcControlData = new ChmLzxcControlData();
        chmLzxcControlData.parse(dir_chunk, chmLzxcControlData);

        indexOfResetTable = chmDirListCont.getResetTableIndex();
        chmLzxcResetTable = new ChmLzxcResetTable();

        int startIndex = (int) chmDirListCont.getDataOffset()
                + chmDirListCont.getDirectoryListingEntryList()
                        .get(indexOfResetTable).getOffset();

        ChmAssert.assertCopyingDataIndex(startIndex, data.length);

        // dir_chunk = Arrays.copyOfRange(data, startIndex, startIndex
        // +
        // chmDirListCont.getDirectoryListingEntryList().get(indexOfResetTable).getLength());
        dir_chunk = ChmCommons.copyOfRange(
                data,
                startIndex,
                startIndex
                        + chmDirListCont.getDirectoryListingEntryList()
                                .get(indexOfResetTable).getLength());

        chmLzxcResetTable.parse(dir_chunk, chmLzxcResetTable);
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.accessor.ChmDirectoryListingSet

    public void testGetChmDirList() {
        Assert.assertNotNull(chmExtractor.getChmDirList());
    }

    public void testExtractChmEntry() throws TikaException{
        ChmDirectoryListingSet entries = chmExtractor.getChmDirList();
        byte[][] localFile;
        int count = 0;
        for (Iterator<DirectoryListingEntry> it = entries
                .getDirectoryListingEntryList().iterator(); it.hasNext();) {
            localFile = chmExtractor.extractChmEntry(it.next());
            if (localFile != null) {
                ++count;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.