private static String getFilenameWithoutPathOrExtension( String filename )
    {
        String newFilename;
        // Remove the ".java" extension from the filename, if it exists
        int extensionIndex = filename.lastIndexOf( ".java" );
        if ( extensionIndex == -1 )
        {
            newFilename = filename;
        }
        else
        {
            newFilename = filename.substring( 0, extensionIndex );
        }

        // Remove the path, after unifying path separators
        newFilename = StringUtils.replace( newFilename, "\\", "/" );
        int pathIndex = newFilename.lastIndexOf( "/" );
        if ( pathIndex == -1 )
        {
            return newFilename;
        }
        else
        {
            return newFilename.substring( pathIndex + 1 );
        }
    }