Class ProjectInfoReportUtils
java.lang.Object
org.apache.maven.report.projectinfo.ProjectInfoReportUtils
Utilities methods.
- Since:
- 2.1
- Version:
- $Id$
- Author:
- Vincent Siveton
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getArchiveServer
(String uri) Convenience method to return the name of a web-based mailing list archive server.static String
getArtifactIdCell
(String artifactId, String link) static String
getContent
(URL url, org.apache.maven.project.MavenProject project, org.apache.maven.settings.Settings settings, String encoding) Get the input stream from a URL.static String
getContent
(URL url, org.apache.maven.settings.Settings settings) Get the input stream using UTF-8 as character encoding from a URL.static String
getContent
(URL url, org.apache.maven.settings.Settings settings, String encoding) Get the input stream from a URL.static String
getProjectUrl
(org.apache.maven.project.MavenProject project) static boolean
isArtifactUrlValid
(String url)
-
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 nullsettings
- 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 nullsettings
- not null to handle proxy settingsencoding
- 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 nullproject
- could be nullsettings
- not null to handle proxy settingsencoding
- 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
- Parameters:
project
- Maven project- Returns:
- the artifact url or null if an error occurred.
-
getArtifactIdCell
- Parameters:
artifactId
- not nulllink
- could be null- Returns:
- the artifactId cell with or without a link pattern
- See Also:
-
isArtifactUrlValid
- Parameters:
url
- not null- Returns:
true
if the url is valid,false
otherwise.
-
getArchiveServer
Convenience method to return the name of a web-based mailing list archive server. For instance, if the archive URI ishttp://www.mail-archive.com/dev@maven.apache.org
, this method returnswww.mail-archive.com
- Parameters:
uri
- the URI parse- Returns:
- the server host of a web-based mailing list archive server
-