(Java) Example: Http.GetCacheRoot method
Demonstrates the GetCacheRoot method.
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[])
{
CkHttp http = new CkHttp();
// Establish 2 cache root directories.
http.AddCacheRoot("c:/example/httpCacheA/");
http.AddCacheRoot("c:/example/httpCacheB/");
System.out.println("Number of cache roots: " + http.get_NumCacheRoots());
System.out.println("1st cache root: " + http.getCacheRoot(0));
System.out.println("2nd cache root: " + http.getCacheRoot(1));
// Output:
// Number of cache roots: 2
// 1st cache root: c:/example/httpCacheA/
// 2nd cache root: c:/example/httpCacheB/
}
}
|