(Java) Transition from ZipEntry.GetDt to ZipEntry.FileDateTimeStr
Provides instructions for replacing deprecated GetDt method calls with FileDateTimeStr. Note: This example requires Chilkat v11.0.0 or greater.
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[])
{
CkZipEntry entry = new CkZipEntry();
// ...
// ...
// ------------------------------------------------------------------------
// The GetDt method is deprecated:
CkDateTime dtObj = entry.GetDt();
if (entry.get_LastMethodSuccess() == false) {
System.out.println(entry.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FileDateTimeStr.
CkDateTime dt = new CkDateTime();
dt.SetFromRfc822(entry.fileDateTimeStr());
}
}
|