This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/v4 by this push:
new 0997a6c7510 CAUSEWAY-3889: adds method ImageType#formatName (quality
of life)
0997a6c7510 is described below
commit 0997a6c75107af87ebdc0f445f5b18146f66c724
Author: Andi Huber <[email protected]>
AuthorDate: Wed Aug 20 07:40:42 2025 +0200
CAUSEWAY-3889: adds method ImageType#formatName (quality of life)
---
.../src/main/java/org/apache/causeway/commons/net/DataUri.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/commons/src/main/java/org/apache/causeway/commons/net/DataUri.java
b/commons/src/main/java/org/apache/causeway/commons/net/DataUri.java
index 7bc496088d5..725f64c91f0 100644
--- a/commons/src/main/java/org/apache/causeway/commons/net/DataUri.java
+++ b/commons/src/main/java/org/apache/causeway/commons/net/DataUri.java
@@ -62,8 +62,14 @@ public enum ImageType {
SVG,
TIFF,
WEBP;
+ /**
+ * The informal name of the format like 'pdf' or 'jpeg' etc.
+ */
+ public String formatName() {
+ return name().toLowerCase(Locale.ROOT);
+ }
public String mediaType() {
- return "image/" + name().toLowerCase(Locale.ROOT);
+ return "image/" + formatName();
}
}