diff --git a/twelvemonkeys-imageio/core/src/main/java/com/twelvemonkeys/imageio/spi/ProviderInfo.java b/twelvemonkeys-imageio/core/src/main/java/com/twelvemonkeys/imageio/spi/ProviderInfo.java index c651b4a8..f9deb312 100644 --- a/twelvemonkeys-imageio/core/src/main/java/com/twelvemonkeys/imageio/spi/ProviderInfo.java +++ b/twelvemonkeys-imageio/core/src/main/java/com/twelvemonkeys/imageio/spi/ProviderInfo.java @@ -16,6 +16,7 @@ public class ProviderInfo { // TODO: Consider reading the META-INF/MANIFEST.MF from the class path using java.util.jar.Manifest. // Use the manifest that is located in the same class path folder as the package. + private final String mTitle; private final String mVendorName; private final String mVersion; @@ -30,6 +31,9 @@ public class ProviderInfo { public ProviderInfo(final Package pPackage) { Validate.notNull(pPackage, "package"); + String title = pPackage.getImplementationTitle(); + mTitle = title != null ? title : pPackage.getName(); + String vendor = pPackage.getImplementationVendor(); mVendorName = vendor != null ? vendor : fakeVendor(pPackage); @@ -47,6 +51,18 @@ public class ProviderInfo { return name.startsWith("com.twelvemonkeys") ? "DEV" : "Unspecified"; } + /** + * Returns the implementation title, as specified in the manifest entry + * {@code Implementation-Title} for the package. + * If the title is unavailable, the package name or some default name + * for known packages are used. + * + * @return the implementation title + */ + final String getImplementationTitle() { + return mTitle; + } + /** * Returns the vendor name, as specified in the manifest entry * {@code Implementation-Vendor} for the package. @@ -69,4 +85,9 @@ public class ProviderInfo { public final String getVersion() { return mVersion; } + + @Override + public String toString() { + return mTitle + ", " + mVersion + " by " + mVendorName; + } }