(Java) Transition from Cert.GetValidFromDt to Cert.ValidFromStr
Provides instructions for replacing deprecated GetValidFromDt method calls with ValidFromStr. 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[])
{
CkCert cert = new CkCert();
// ------------------------------------------------------------------------
// The GetValidFromDt method is deprecated:
CkDateTime ckdt1 = cert.GetValidFromDt();
if (cert.get_LastMethodSuccess() == false) {
System.out.println(cert.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using the ValidFromStr property
CkDateTime ckdt2 = new CkDateTime();
ckdt2.SetFromRfc822(cert.validFromStr());
}
}
|