Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Treeverse LakeFS Java SDK ApiClient

From Leeroopedia


Knowledge Sources
Domains Java_SDK, REST_API
Last Updated 2026-02-08 00:00 GMT

Overview

Concrete tool for HTTP client configuration, authentication setup, SSL, and timeout management provided by the lakeFS Java SDK.

Description

The ApiClient class is an auto-generated Java client that serves as the central HTTP transport layer for all lakeFS Java SDK operations. It is generated by OpenAPI Generator from the lakeFS OpenAPI specification and manages OkHttp-based HTTP connections, authentication schemes (Basic, Bearer JWT, API Key), SSL/TLS certificate handling, request/response interceptors, timeout configuration, and JSON serialization via Gson.

Usage

Import this class when configuring programmatic access to a lakeFS server from a Java application. Set the base URL, authentication credentials, and any custom HTTP settings before passing the client to API class constructors.

Code Reference

Source Location

Signature

public class ApiClient {
    private String basePath = "http://localhost/api/v1";
    private boolean debugging = false;
    private Map<String, Authentication> authentications;
    private OkHttpClient httpClient;
    private JSON json;

    public ApiClient() { ... }
    public ApiClient(OkHttpClient client) { ... }
    // Configuration methods...
}

Import

import io.lakefs.clients.sdk.ApiClient;

I/O Contract

Inputs

Name Type Required Description
basePath String No Server base URL (defaults to http://localhost/api/v1)
httpClient OkHttpClient No Custom OkHttp client instance (uses default if omitted)

Outputs

Name Type Description
Configured client ApiClient Fully configured HTTP client ready for API class injection

Usage Examples

Basic Usage

import io.lakefs.clients.sdk.ApiClient;
import io.lakefs.clients.sdk.Configuration;
import io.lakefs.clients.sdk.auth.HttpBasicAuth;

// Use default client
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("http://localhost:8000/api/v1");

// Configure authentication
HttpBasicAuth basicAuth = (HttpBasicAuth) client.getAuthentication("basic_auth");
basicAuth.setUsername("AKIAIOSFODNN7EXAMPLE");
basicAuth.setPassword("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY");

// Pass to API classes

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment