Example usage for org.apache.commons.imaging ImageFormat getName

List of usage examples for org.apache.commons.imaging ImageFormat getName

Introduction

In this page you can find the example usage for org.apache.commons.imaging ImageFormat getName.

Prototype

public String getName() 

Source Link

Usage

From source file:com.vividsolutions.jump.workbench.imagery.graphic.CommonsImageFactory.java

public boolean isAvailable(WorkbenchContext context) {
    Class c = null;/*w w  w .jav a  2  s  .c om*/
    try {
        c = this.getClass().getClassLoader().loadClass("org.apache.commons.imaging.Imaging");
        if (c == null)
            return false;

        for (ImageFormat fmt : ImageFormat.getAllFormats()) {
            // skip mysterious unknown entry
            if (fmt.getName().equalsIgnoreCase("unknown"))
                continue;
            String ext = fmt.getExtension().toLowerCase();
            addExtension(ext);
        }

        //      System.out.println(this.getClass().getName()+": "+extensions);
        return true;
    } catch (ClassNotFoundException e) {
        // eat it
    }

    return false;
}