mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-11 16:16:47 -04:00
Exception is properly created by jni wrapper.
No need to do the check in java code.
This commit is contained in:
parent
36ad3c0331
commit
33152da9b4
@ -31,26 +31,17 @@ public class Archive
|
|||||||
public Archive(String filename) throws ZimFileFormatException
|
public Archive(String filename) throws ZimFileFormatException
|
||||||
{
|
{
|
||||||
setNativeArchive(filename);
|
setNativeArchive(filename);
|
||||||
if (nativeHandle == 0) {
|
|
||||||
throw new ZimFileFormatException("Cannot open zimfile "+filename);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Archive(FileDescriptor fd) throws ZimFileFormatException
|
public Archive(FileDescriptor fd) throws ZimFileFormatException
|
||||||
{
|
{
|
||||||
setNativeArchiveByFD(fd);
|
setNativeArchiveByFD(fd);
|
||||||
if (nativeHandle == 0) {
|
|
||||||
throw new ZimFileFormatException("Cannot open zimfile by fd "+fd.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Archive(FileDescriptor fd, long offset, long size)
|
public Archive(FileDescriptor fd, long offset, long size)
|
||||||
throws ZimFileFormatException
|
throws ZimFileFormatException
|
||||||
{
|
{
|
||||||
setNativeArchiveEmbedded(fd, offset, size);
|
setNativeArchiveEmbedded(fd, offset, size);
|
||||||
if (nativeHandle == 0) {
|
|
||||||
throw new ZimFileFormatException(String.format("Cannot open embedded zimfile (fd=%s, offset=%d, size=%d)", fd, offset, size));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public native String getFilename();
|
public native String getFilename();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user