(Java) Transition from Zip.AppendSb to Zip.AddSb
Provides instructions for replacing deprecated AppendSb method calls with AddSb. 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[])
{
CkZip zip = new CkZip();
// ...
// ...
String pathInZip = "example.txt";
CkStringBuilder sb = new CkStringBuilder();
sb.Append("This is a test");
String charset = "utf-8";
// ------------------------------------------------------------------------
// The AppendSb method is deprecated:
boolean success = zip.AppendSb(pathInZip,sb,charset);
// ------------------------------------------------------------------------
// For consistency, the name has changed to AddSb.
success = zip.AddSb(pathInZip,sb,charset);
}
}
|