Skip to content

Commit 33152da

Browse files
committed
Exception is properly created by jni wrapper.
No need to do the check in java code.
1 parent 36ad3c0 commit 33152da

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

lib/src/main/java/org/kiwix/libzim/Archive.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,17 @@ public class Archive
3131
public Archive(String filename) throws ZimFileFormatException
3232
{
3333
setNativeArchive(filename);
34-
if (nativeHandle == 0) {
35-
throw new ZimFileFormatException("Cannot open zimfile "+filename);
36-
}
3734
}
3835

3936
public Archive(FileDescriptor fd) throws ZimFileFormatException
4037
{
4138
setNativeArchiveByFD(fd);
42-
if (nativeHandle == 0) {
43-
throw new ZimFileFormatException("Cannot open zimfile by fd "+fd.toString());
44-
}
4539
}
4640

4741
public Archive(FileDescriptor fd, long offset, long size)
4842
throws ZimFileFormatException
4943
{
5044
setNativeArchiveEmbedded(fd, offset, size);
51-
if (nativeHandle == 0) {
52-
throw new ZimFileFormatException(String.format("Cannot open embedded zimfile (fd=%s, offset=%d, size=%d)", fd, offset, size));
53-
}
5445
}
5546

5647
public native String getFilename();

0 commit comments

Comments
 (0)