From d7108f60ae8f6d229fcd425a7cfc2010b64a6bf4 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 4 Jan 2024 09:28:53 +0100 Subject: [PATCH] Added #toString methods to Resource implementations --- .../apache/hc/client5/http/impl/cache/FileResource.java | 8 ++++++++ .../apache/hc/client5/http/impl/cache/HeapResource.java | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/FileResource.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/FileResource.java index 69ed1a412..4636bdaf3 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/FileResource.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/FileResource.java @@ -109,4 +109,12 @@ public class FileResource extends Resource { } } + @Override + public String toString() { + return "[" + + "file=" + getFile() + "," + + "len=" + length() + + ']'; + } + } diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HeapResource.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HeapResource.java index 8a23e3916..a632f5266 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HeapResource.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HeapResource.java @@ -74,4 +74,12 @@ public class HeapResource extends Resource { this.arrayRef.set(null); } + @Override + public String toString() { + return "[" + + "heap," + + "len=" + length() + + ']'; + } + }