Class ChmAssert
java.lang.Object
org.apache.tika.parser.microsoft.chm.ChmAssert
Contains chm extractor assertions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
assertByteArrayNotNull
(byte[] data) Checks if byte[] is not nullstatic final void
assertChmAccessorNotNull
(ChmAccessor<?> chmAccessor) Checks if ChmAccessor is not null In case of null throws exceptionstatic final void
assertChmAccessorParameters
(byte[] data, ChmAccessor<?> chmAccessor, int count) Checks validity of ChmAccessor parametersstatic final void
assertChmBlockSegment
(byte[] data, ChmLzxcResetTable resetTable, int blockNumber, int lzxcBlockOffset, int lzxcBlockLength) Checks a validity of the chmBlockSegment parametersstatic void
assertCopyingDataIndex
(int index, int dataLength) static final void
assertDirectoryListingEntry
(int name_length, String name, ChmCommons.EntryType entryType, int offset, int length) Checks validity of the DirectoryListingEntry's parameters In case of invalid parameter(s) throws an exceptionstatic final void
Checks if InputStream is not nullstatic void
assertPositiveInt
(int param) Checks if int param is greater than zero In case param <= 0 throws an exception
-
Constructor Details
-
ChmAssert
public ChmAssert()
-
-
Method Details
-
assertChmBlockSegment
public static final void assertChmBlockSegment(byte[] data, ChmLzxcResetTable resetTable, int blockNumber, int lzxcBlockOffset, int lzxcBlockLength) throws TikaException Checks a validity of the chmBlockSegment parameters- Parameters:
data
- byte[]resetTable
- ChmLzxcResetTableblockNumber
- intlzxcBlockOffset
- intlzxcBlockLength
- int- Throws:
TikaException
-
assertInputStreamNotNull
Checks if InputStream is not null- Parameters:
is
- InputStream- Throws:
ChmParsingException
IOException
-
assertChmAccessorParameters
public static final void assertChmAccessorParameters(byte[] data, ChmAccessor<?> chmAccessor, int count) throws ChmParsingException Checks validity of ChmAccessor parameters- Parameters:
data
-chmAccessor
-count
-- Throws:
ChmParsingException
-
assertByteArrayNotNull
Checks if byte[] is not null- Parameters:
data
-- Throws:
ChmParsingException
-
assertChmAccessorNotNull
public static final void assertChmAccessorNotNull(ChmAccessor<?> chmAccessor) throws ChmParsingException Checks if ChmAccessor is not null In case of null throws exception- Parameters:
chmAccessor
-- Throws:
ChmParsingException
-
assertDirectoryListingEntry
public static final void assertDirectoryListingEntry(int name_length, String name, ChmCommons.EntryType entryType, int offset, int length) throws ChmParsingException Checks validity of the DirectoryListingEntry's parameters In case of invalid parameter(s) throws an exception- Parameters:
name_length
- length of the chm entry namename
- chm entry nameentryType
- EntryTypeoffset
-length
-- Throws:
ChmParsingException
-
assertCopyingDataIndex
- Throws:
ChmParsingException
-
assertPositiveInt
Checks if int param is greater than zero In case param <= 0 throws an exception- Parameters:
param
-- Throws:
ChmParsingException
-