org.gcube.vremanagement.softwarerepository.repository.impl.maven.utils
Class MavenResultTreeParser

java.lang.Object
  extended by org.gcube.vremanagement.softwarerepository.repository.impl.maven.utils.MavenResultTreeParser

public class MavenResultTreeParser
extends java.lang.Object

Author:
Luca Frosini (ISTI-CNR)

Field Summary
static java.lang.String CONTINUE
          Continue Token
static java.lang.String INDENT
          Second level indent
static java.lang.String LAST_OF_THIS_LEVEL
          Last in the level token
static java.lang.String MORE_ON_THIS_LEVEL
          More on this level token
static java.lang.String MORE_ON_THIS_LEVEL_REGEX
          More on this level toker (regular expression)
 
Constructor Summary
MavenResultTreeParser(java.io.File treeFile)
          Constructor
 
Method Summary
static ArtifactCoordinates getArtifactInfo(java.lang.String artifactCoordinates)
           
 java.lang.String getScopedDependecy(ScopeLevel scope)
          Build the tree parsing file
 java.lang.String listDependency()
           
 java.lang.String[] listDependencyArray()
           
 java.lang.String printTree()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MORE_ON_THIS_LEVEL

public static final java.lang.String MORE_ON_THIS_LEVEL
More on this level token

See Also:
Constant Field Values

MORE_ON_THIS_LEVEL_REGEX

public static final java.lang.String MORE_ON_THIS_LEVEL_REGEX
More on this level toker (regular expression)

See Also:
Constant Field Values

LAST_OF_THIS_LEVEL

public static final java.lang.String LAST_OF_THIS_LEVEL
Last in the level token

See Also:
Constant Field Values

CONTINUE

public static final java.lang.String CONTINUE
Continue Token

See Also:
Constant Field Values

INDENT

public static final java.lang.String INDENT
Second level indent

See Also:
Constant Field Values
Constructor Detail

MavenResultTreeParser

public MavenResultTreeParser(java.io.File treeFile)
                      throws java.lang.Exception
Constructor

Parameters:
treeFile - file to parse
Throws:
java.lang.Exception - if the file does not exist
Method Detail

getScopedDependecy

public java.lang.String getScopedDependecy(ScopeLevel scope)
                                    throws java.lang.Exception
Build the tree parsing file

Parameters:
scope - scope to filter
Returns:
xml representation of tree filtered by scope
Throws:
java.lang.Exception - if parsing tree fails

getArtifactInfo

public static ArtifactCoordinates getArtifactInfo(java.lang.String artifactCoordinates)
                                           throws java.lang.Exception
Parameters:
artifactCoordinates - string representing artifact ex. Portal.ThumbnailService.1.00.00:Thumbnailer-service:tar.gz:GHN:1.00.00:runtime
Returns:
ArtifactCoordinates class
Throws:
java.lang.Exception - if Artifact coordinates differs from template

printTree

public java.lang.String printTree()
Returns:
String representation of the tree

listDependencyArray

public java.lang.String[] listDependencyArray()
                                       throws java.lang.Exception
Returns:
List of dependency. Each element is a piece of XML
Throws:
java.lang.Exception - if fails

listDependency

public java.lang.String listDependency()
                                throws java.lang.Exception
Returns:
List of dependency as single XML string
Throws:
java.lang.Exception - if fails