org.apache.maven.report.projectinfo
Class ProjectInfoReportUtils

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

public class ProjectInfoReportUtils
extends Object

Utilities methods.

Since:
2.1
Version:
$Id: ProjectInfoReportUtils.java 1376708 2012-08-23 21:28:55Z hboutemy $
Author:
Vincent Siveton

Constructor Summary
ProjectInfoReportUtils()
           
 
Method Summary
static String getArtifactIdCell(String artifactId, String link)
           
static String getArtifactUrl(org.apache.maven.artifact.factory.ArtifactFactory factory, Artifact artifact, MavenProjectBuilder mavenProjectBuilder, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository)
           
static String getContent(URL url, MavenProject project, Settings settings, String encoding)
          Get the input stream from an URL.
static String getContent(URL url, Settings settings)
          Get the input stream using ISO-8859-1 as charset from an URL.
static String getContent(URL url, Settings settings, String encoding)
          Get the input stream from an URL.
static boolean isArtifactUrlValid(String url)
           
static boolean isNumber(String str)
           
static float toFloat(String str, float defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectInfoReportUtils

public ProjectInfoReportUtils()
Method Detail

getContent

public static String getContent(URL url,
                                Settings settings)
                         throws IOException
Get the input stream using ISO-8859-1 as charset from an URL.

Parameters:
url - not null
settings - not null to handle proxy settings
Returns:
the ISO-8859-1 inputstream found.
Throws:
IOException - if any
See Also:
getContent(URL, Settings, String)

getContent

public static String getContent(URL url,
                                Settings settings,
                                String encoding)
                         throws IOException
Get the input stream from an URL.

Parameters:
url - not null
settings - not null to handle proxy settings
encoding - the wanted encoding for the inputstream. If null, encoding will be "ISO-8859-1".
Returns:
the inputstream found depending the wanted encoding.
Throws:
IOException - if any

getContent

public static String getContent(URL url,
                                MavenProject project,
                                Settings settings,
                                String encoding)
                         throws IOException
Get the input stream from an URL.

Parameters:
url - not null
project - could be null
settings - not null to handle proxy settings
encoding - the wanted encoding for the inputstream. If empty, encoding will be "ISO-8859-1".
Returns:
the inputstream found depending the wanted encoding.
Throws:
IOException - if any
Since:
2.3

getArtifactUrl

public static String getArtifactUrl(org.apache.maven.artifact.factory.ArtifactFactory factory,
                                    Artifact artifact,
                                    MavenProjectBuilder mavenProjectBuilder,
                                    List<ArtifactRepository> remoteRepositories,
                                    ArtifactRepository localRepository)
Parameters:
factory - not null
artifact - not null
mavenProjectBuilder - not null
remoteRepositories - not null
localRepository - not null
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.

isNumber

public static boolean isNumber(String str)

toFloat

public static float toFloat(String str,
                            float defaultValue)


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.