Sample code for 30+ languages & platforms
Java

Example: Http.GetUrlPath method

Demonstrates the GetUrlPath method.

Chilkat Java Downloads

Java
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;

    CkHttp http = new CkHttp();
    String url = "https://example.com/folder/page?lang=en&sort=asc#section2";
    System.out.println(http.getUrlPath(url));

    //  Output:

    //  /folder/page
  }
}