Class GitStatusConsumer

  • All Implemented Interfaces:
    org.codehaus.plexus.util.cli.StreamConsumer

    public class GitStatusConsumer
    extends java.lang.Object
    implements org.codehaus.plexus.util.cli.StreamConsumer
    Author:
    Mark Struberg
    • Constructor Summary

      Constructors 
      Constructor Description
      GitStatusConsumer​(ScmLogger logger, java.io.File workingDirectory)
      Consumer when workingDirectory and repositoryRootDirectory are the same
      GitStatusConsumer​(ScmLogger logger, java.io.File workingDirectory, java.net.URI relativeRepositoryPath)
      Assuming that you have to discover the repositoryRoot, this is how you can get the relativeRepositoryPath
      GitStatusConsumer​(ScmLogger logger, java.io.File workingDirectory, java.net.URI relativeRepositoryPath, ScmFileSet scmFileSet)
      Assuming that you have to discover the repositoryRoot, this is how you can get the relativeRepositoryPath
      GitStatusConsumer​(ScmLogger logger, java.io.File workingDirectory, ScmFileSet scmFileSet)
      Assuming that you have to discover the repositoryRoot, this is how you can get the relativeRepositoryPath
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void consumeLine​(java.lang.String line)
      java.util.List<ScmFile> getChangedFiles()  
      protected static java.lang.String resolvePath​(java.lang.String fileEntry, java.net.URI path)  
      static java.net.URI resolveURI​(java.lang.String fileEntry, java.net.URI path)  
      static java.net.URI uriFromPath​(java.lang.String path)
      Create an URI whose getPath() returns the given path and getScheme() returns null.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GitStatusConsumer

        public GitStatusConsumer​(ScmLogger logger,
                                 java.io.File workingDirectory)
        Consumer when workingDirectory and repositoryRootDirectory are the same
        Parameters:
        logger - the logger
        workingDirectory - the working directory
      • GitStatusConsumer

        public GitStatusConsumer​(ScmLogger logger,
                                 java.io.File workingDirectory,
                                 java.net.URI relativeRepositoryPath)
        Assuming that you have to discover the repositoryRoot, this is how you can get the relativeRepositoryPath
         URI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
         
        Parameters:
        logger - the logger
        workingDirectory - the working directory
        relativeRepositoryPath - the working directory relative to the repository root
        Since:
        1.9
        See Also:
        GitStatusCommand.createRevparseShowPrefix(org.apache.maven.scm.ScmFileSet)
      • GitStatusConsumer

        public GitStatusConsumer​(ScmLogger logger,
                                 java.io.File workingDirectory,
                                 ScmFileSet scmFileSet)
        Assuming that you have to discover the repositoryRoot, this is how you can get the relativeRepositoryPath
         URI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
         
        Parameters:
        logger - the logger
        workingDirectory - the working directory
        scmFileSet - fileset with includes and excludes
        Since:
        1.11.0
        See Also:
        GitStatusCommand#createRevparseShowToplevelCommand(org.apache.maven.scm.ScmFileSet)
      • GitStatusConsumer

        public GitStatusConsumer​(ScmLogger logger,
                                 java.io.File workingDirectory,
                                 java.net.URI relativeRepositoryPath,
                                 ScmFileSet scmFileSet)
        Assuming that you have to discover the repositoryRoot, this is how you can get the relativeRepositoryPath
         URI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
         
        Parameters:
        logger - the logger
        workingDirectory - the working directory
        relativeRepositoryPath - the working directory relative to the repository root
        scmFileSet - fileset with includes and excludes
        Since:
        1.11.0
        See Also:
        GitStatusCommand#createRevparseShowToplevelCommand(org.apache.maven.scm.ScmFileSet)
    • Method Detail

      • consumeLine

        public void consumeLine​(java.lang.String line)
        Specified by:
        consumeLine in interface org.codehaus.plexus.util.cli.StreamConsumer
      • resolvePath

        protected static java.lang.String resolvePath​(java.lang.String fileEntry,
                                                      java.net.URI path)
      • resolveURI

        public static java.net.URI resolveURI​(java.lang.String fileEntry,
                                              java.net.URI path)
        Parameters:
        fileEntry - the fileEntry, must not be null
        path - the path, must not be null
        Returns:
      • uriFromPath

        public static java.net.URI uriFromPath​(java.lang.String path)
        Create an URI whose getPath() returns the given path and getScheme() returns null. The path may contain spaces, colons, and other special characters.
        Parameters:
        path - the path.
        Returns:
        the new URI
      • getChangedFiles

        public java.util.List<ScmFile> getChangedFiles()