Package org.apache.tika.parser.chm.exception

Examples of org.apache.tika.parser.chm.exception.ChmParsingException


        this.chmSection = chmSection;
    }

    private void assertStateNotNull() throws TikaException {
        if (getState() == null)
            throw new ChmParsingException("state is null");
    }
View Full Code Here


    private void createLengthTreeTable() throws TikaException {
        short[] prelentable = createPreLenTable();

        if (prelentable == null) {
            throw new ChmParsingException("pretreetable is null");
        }

        short[] pretreetable = createTreeTable2(prelentable,
                (1 << ChmConstants.LZX_PRETREE_TABLEBITS)
                        + (ChmConstants.LZX_PRETREE_MAXSYMBOLS << 1),
                ChmConstants.LZX_PRETREE_TABLEBITS,
                ChmConstants.LZX_PRETREE_MAXSYMBOLS);

        if (pretreetable == null) {
            throw new ChmParsingException("pretreetable is null");
        }

        createLengthTreeLenTable(0, ChmConstants.LZX_NUM_SECONDARY_LENGTHS,
                pretreetable, prelentable);
View Full Code Here

    private void decompressAlignedBlock(int len, byte[] prevcontent) throws TikaException {

        if ((getChmSection() == null) || (getState() == null)
                || (getState().getMainTreeTable() == null))
            throw new ChmParsingException("chm section is null");

        short s;
        int x, i, border;
        int matchlen = 0, matchfooter = 0, extra, rundest, runsrc;
        int matchoffset = 0;
View Full Code Here

        setContentLength(len);
    }

    private void assertShortArrayNotNull(short[] array) throws TikaException {
        if (array == null)
            throw new ChmParsingException("short[] is null");
    }
View Full Code Here

    private void createLengthTreeLenTable(int offset, int tablelen,
            short[] pretreetable, short[] prelentable) throws TikaException {
        if (prelentable == null || getChmSection() == null
                || pretreetable == null || prelentable == null)
            throw new ChmParsingException("is null");

        int i = offset; // represents offset
        int z, y, x;// local counters
        while (i < tablelen) {
            z = pretreetable[(int) getChmSection().getDesyncBits(
View Full Code Here

    }

    private void createMainTreeLenTable(int offset, int tablelen,
            short[] pretreetable, short[] prelentable) throws TikaException {
        if (pretreetable == null)
            throw new ChmParsingException("pretreetable is null");
        int i = offset;
        int z, y, x;
        while (i < tablelen) {
            int f = getChmSection().getDesyncBits(
                    ChmConstants.LZX_PRETREE_TABLEBITS, 0);
View Full Code Here

        }
    }

    private void assertInRange(short[] array, int index) throws ChmParsingException {
        if (index >= array.length)
            throw new ChmParsingException(index + " is bigger than "
                    + array.length);
    }
View Full Code Here

            byte[] dataSegment, long blockLength) throws TikaException {
        int goodParameter = 0;
        if (blockNumber >= 0)
            ++goodParameter;
        else
            throw new ChmParsingException("block number should be possitive");
        if (dataSegment != null && dataSegment.length > 0)
            ++goodParameter;
        else
            throw new ChmParsingException("data segment should not be null");
        if (blockLength > 0)
            ++goodParameter;
        else
            throw new ChmParsingException(
                    "block length should be more than zero");
        return (goodParameter == 3);
    }
View Full Code Here

            chmLzxcResetTable.setBlockAddress(enumerateBlockAddresses(data));
        }

        /* checks chmLzxcResetTable */
        if (chmLzxcResetTable.getVersion() != ChmConstants.CHM_VER_2)
            throw new ChmParsingException(
                    "does not seem currect version of chmLzxcResetTable");
    }
View Full Code Here

                throw new TikaException("something wrong with header");
        } else if (chmItsfHeader.getVersion() == ChmConstants.CHM_VER_3) {
            if (chmItsfHeader.getHeaderLen() < ChmConstants.CHM_ITSF_V3_LEN)
                throw new TikaException("unknown v3 header lenght");
        } else
            throw new ChmParsingException("unsupported chm format");

        /*
         * now, if we have a V3 structure, unmarshal the rest, otherwise,
         * compute it
         */
 
View Full Code Here

TOP

Related Classes of org.apache.tika.parser.chm.exception.ChmParsingException

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.