mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-16 21:19:19 +01:00
36 lines
904 B
Java
36 lines
904 B
Java
|
package de.mas.jnus.lib.implementations.woomy;
|
||
|
|
||
|
import java.io.File;
|
||
|
import java.io.IOException;
|
||
|
import java.util.zip.ZipEntry;
|
||
|
import java.util.zip.ZipException;
|
||
|
import java.util.zip.ZipFile;
|
||
|
|
||
|
import de.mas.jnus.lib.utils.StreamUtils;
|
||
|
import lombok.Getter;
|
||
|
import lombok.Setter;
|
||
|
|
||
|
/**
|
||
|
* Woomy files are just zip files. This class is just the
|
||
|
* normal ZipFile class extended by an "isClosed" attribute.
|
||
|
* @author Maschell
|
||
|
*
|
||
|
*/
|
||
|
public class WoomyZipFile extends ZipFile {
|
||
|
@Getter @Setter boolean isClosed;
|
||
|
public WoomyZipFile(File file) throws ZipException, IOException {
|
||
|
super(file);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void close() throws IOException {
|
||
|
super.close();
|
||
|
setClosed(true);
|
||
|
}
|
||
|
|
||
|
public byte[] getEntryAsByte(ZipEntry entry) throws IOException {
|
||
|
return StreamUtils.getBytesFromStream(getInputStream(entry),(int) entry.getSize());
|
||
|
}
|
||
|
|
||
|
}
|