Example usage for org.eclipse.jdt.core JavaCore getJavaLikeExtensions

List of usage examples for org.eclipse.jdt.core JavaCore getJavaLikeExtensions

Introduction

In this page you can find the example usage for org.eclipse.jdt.core JavaCore getJavaLikeExtensions.

Prototype

public static String[] getJavaLikeExtensions() 

Source Link

Document

Returns the list of known Java-like extensions.

Usage

From source file:fede.workspace.eclipse.java.JavaProjectManager.java

License:Apache License

/**
 * Determines if a file name corresponds to a Java source file name.
 * //from   ww  w.  jav a2s .co m
 * @param fileName
 *            the file name
 * 
 * @return true, if checks if is java file name
 */
public static boolean isJavaFileName(String fileName) {
    String extension = fileName.substring(fileName.lastIndexOf("."));
    for (String javaExtension : JavaCore.getJavaLikeExtensions()) {
        if (javaExtension.equals(extension)) {
            return true;
        }
    }

    return false;
}