code: public static String colorizeResource(FileResource<?> resource)
     {
        String name = resource.getName();
        if (resource.isDirectory())
        {
           name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
        }
        else if (resource.isExecutable())
        {
           name = new TerminalString(name, new TerminalColor(Color.GREEN, Color.DEFAULT)).toString();
        }
        return name;
     }
docs: Applies ANSI colors in a specific resource
  
  @param resource
  @return