Class ZipReader
java.lang.Object
org.apache.sling.jcr.contentloader.internal.readers.ZipReader
- All Implemented Interfaces:
ContentReader
The
ZipReader- Since:
- 2.0.4
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.apache.sling.jcr.contentloader.ContentReader
PROPERTY_EXTENSIONS, PROPERTY_TYPES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcopyZipEntryToTempFile(File tempFile, ZipInputStream zis, ZipEntry entry, int totalSizeArchive, int totalEntryArchive) Copy the contents of a zip entry to a temp file and check the entry contents against the configured threshold for violationsvoidparse(InputStream ins, ContentCreator creator) Read the content from the input stream and create the content using the provided content creator.voidparse(URL url, ContentCreator creator) Read the content from the URL and create the content using the provided content creator.
-
Constructor Details
-
ZipReader
public ZipReader()
-
-
Method Details
-
parse
public void parse(URL url, ContentCreator creator) throws IOException, javax.jcr.RepositoryException Description copied from interface:ContentReaderRead the content from the URL and create the content using the provided content creator.- Specified by:
parsein interfaceContentReader- Parameters:
url- The input stream.- Throws:
IOException- If anything goes wrong.javax.jcr.RepositoryException- See Also:
-
parse
public void parse(InputStream ins, ContentCreator creator) throws IOException, javax.jcr.RepositoryException Description copied from interface:ContentReaderRead the content from the input stream and create the content using the provided content creator.- Specified by:
parsein interfaceContentReader- Parameters:
ins- the input stream.- Throws:
IOException- If anything goes wrong.javax.jcr.RepositoryException- See Also:
-
copyZipEntryToTempFile
protected int copyZipEntryToTempFile(File tempFile, ZipInputStream zis, ZipEntry entry, int totalSizeArchive, int totalEntryArchive) throws IOException Copy the contents of a zip entry to a temp file and check the entry contents against the configured threshold for violations- Parameters:
tempFile- the temp file to write the entry tozis- the input stream for the zip file we are processingentry- the current zip entrytotalSizeArchive- the total size of the archive so fartotalEntryArchive- the total number of entries so far- Returns:
- the new totalSizeArchive value after reading the entry
- Throws:
IOException
-