What's the type of a folder/directory concerning the validation for a MenuItem?

[MenuItem(“Assets/Compile Folder”, true)]
static bool CompileSourceFiles()
{
return Selection.activeObject.GetType() == typeof();
}

I’d like to add a menuitem to the context menu, which is only available if the right-click has been done on a folder.

Unity’s example is just about a Texture2D type. After enabling the menuitems for folder, how can I get the path of the folder?

Question is solved. The solution can be foun on Gist at GitHub

Found the solution already:

Validation function:

    [MenuItem("Assets/Compile Folder", true)]
    private static bool CompileSourceFilesValidation()
    {
        string filePath = AssetDatabase.GetAssetPath(Selection.activeObject);
        FileAttributes attr = File.GetAttributes(filePath);
        return ((attr & FileAttributes.Directory) == FileAttributes.Directory);
    }