Common

Date Handing

Reflection

IO

HTTP Request

Cryptography

Misc.

Response Handler Utility

Provides methods for processing HTTP responses in various formats.

Features

Usage Examples

// Convert response to JSON
Map<String, Object> json = ResponseHandler.toJson(response);

// Convert response to XML
Map<String, String> xml = ResponseHandler.toXML(response);

// Download file from response
String filePath = ResponseHandler.download(response, "/downloads", "file.pdf");

Connection Setup Utility

Provides common configurations for HTTP connections.

Features

Usage Examples

// Set custom User-Agent
connectionConsumer = SetConnection.SET_USER_AGENT.andThen(conn -> conn.setRequestProperty("User-Agent", "MyApp/1.0"));

// Set cookies
Map<String, String> cookies = ObjectHelper.mapOf("session", "12345");
SetConnection.SET_COOKIES.accept(connection, cookies);

Batch Download Utility

Provides concurrent downloading of multiple files.

Features

Usage Examples

String[] urls = {
    "https://example.com/file1.pdf",
    "https://example.com/file2.pdf"
};

BatchDownload downloader = new BatchDownload(urls, "/downloads", 
    () -> "custom_" + System.currentTimeMillis());
    
downloader.start();
String[] downloadedNames = downloader.getFileNames();

The input URL array is copied and is never overwritten. Result names are stored separately and use Path.getFileName(), so Unix and Windows paths are handled consistently.

Multipart file upload

FileUpload.upload(...) creates a random boundary for every request, encodes headers and text fields as UTF-8, and streams File values to the connection. Empty multipart maps and invalid field names are rejected explicitly; null field values are serialized as empty text fields. writeFormData(...) exposes the same streaming encoder for custom transports.

Head.gzip(...) returns the original stream when the response is not gzip encoded. Invalid gzip content causes UncheckedIOException with the original IOException as its cause.

SSL Certificate Utility

Provides methods for handling SSL certificate verification.

Features

Usage Examples

// Skip SSL verification globally
SkipSSL.init();

// Skip SSL verification for single connection
SkipSSL.setSSL_Ignore((HttpsURLConnection)connection);

// Load custom certificate
KeyManager[] kms = SkipSSL.loadCert("/path/to/cert.p12", "password");
SSLSocketFactory sf = SkipSSL.getSocketFactory(kms);