Class ProjectInfoReportUtils

java.lang.Object
org.apache.maven.report.projectinfo.ProjectInfoReportUtils

public class ProjectInfoReportUtils extends Object
Utilities methods.
Since:
2.1
Version:
$Id$
Author:
Vincent Siveton
  • Constructor Details

    • ProjectInfoReportUtils

      public ProjectInfoReportUtils()
  • Method Details

    • getContent

      public static String getContent(URL url, org.apache.maven.settings.Settings settings) throws IOException
      Get the input stream using UTF-8 as character encoding from a URL.
      Parameters:
      url - not null
      settings - not null to handle proxy settings
      Returns:
      the UTF-8 decoded input stream as string
      Throws:
      IOException - if any
      See Also:
    • getContent

      public static String getContent(URL url, org.apache.maven.settings.Settings settings, String encoding) throws IOException
      Get the input stream from a URL.
      Parameters:
      url - not null
      settings - not null to handle proxy settings
      encoding - the wanted encoding for the URL input stream. If null, UTF-8 will be used.
      Returns:
      the input stream decoded with the wanted encoding as string
      Throws:
      IOException - if any
    • getContent

      public static String getContent(URL url, org.apache.maven.project.MavenProject project, org.apache.maven.settings.Settings settings, String encoding) throws IOException
      Get the input stream from a URL.
      Parameters:
      url - not null
      project - could be null
      settings - not null to handle proxy settings
      encoding - the wanted encoding for the URL input stream. If null, UTF-8 will be used.
      Returns:
      the input stream decoded with the wanted encoding as string
      Throws:
      IOException - if any
      Since:
      2.3
    • getProjectUrl

      public static String getProjectUrl(org.apache.maven.project.MavenProject project)
      Parameters:
      project - Maven project
      Returns:
      the artifact url or null if an error occurred.
    • getArtifactIdCell

      public static String getArtifactIdCell(String artifactId, String link)
      Parameters:
      artifactId - not null
      link - could be null
      Returns:
      the artifactId cell with or without a link pattern
      See Also:
      • AbstractMavenReportRenderer.linkPatternedText(String)
    • isArtifactUrlValid

      public static boolean isArtifactUrlValid(String url)
      Parameters:
      url - not null
      Returns:
      true if the url is valid, false otherwise.
    • getArchiveServer

      public static String getArchiveServer(String uri)
      Convenience method to return the name of a web-based mailing list archive server. For instance, if the archive URI is http://www.mail-archive.com/dev@maven.apache.org, this method returns www.mail-archive.com
      Parameters:
      uri - the URI parse
      Returns:
      the server host of a web-based mailing list archive server