Java
Java
Transition from Zip.FirstEntry to Zip.EntryAt
Provides instructions for replacing deprecated FirstEntry method calls with EntryAt.Chilkat Java Downloads
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
boolean success = false;
CkZip zip = new CkZip();
// ...
// ...
// ------------------------------------------------------------------------
// The FirstEntry method is deprecated:
CkZipEntry entryObj = zip.FirstEntry();
if (zip.get_LastMethodSuccess() == false) {
System.out.println(zip.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using EntryAt.
// Your application creates a new, empty ZipEntry object which is passed
// in the last argument and filled upon success.
// The 1st entry is at index 0.
CkZipEntry ze = new CkZipEntry();
success = zip.EntryAt(0,ze);
if (success == false) {
System.out.println(zip.lastErrorText());
return;
}
}
}