Package org.apache.tika.zip.utils
Class ZipSalvager
java.lang.Object
org.apache.tika.zip.utils.ZipSalvager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
salvageCopy
(File brokenZip, File salvagedZip) static void
salvageCopy
(InputStream brokenZip, File salvagedZip, boolean allowStoredEntries) This streams the broken zip and rebuilds a new zip that is at least a valid zip file.
-
Constructor Details
-
ZipSalvager
public ZipSalvager()
-
-
Method Details
-
salvageCopy
public static void salvageCopy(InputStream brokenZip, File salvagedZip, boolean allowStoredEntries) throws IOException This streams the broken zip and rebuilds a new zip that is at least a valid zip file. The contents of the final stream may be truncated, but the result should be a valid zip file.This does nothing fancy to fix the underlying broken zip.
This will close the inputstream
- Parameters:
brokenZip
-salvagedZip
-- Throws:
IOException
-
salvageCopy
- Throws:
IOException
-