org.apache.maven.scm.provider.perforce.command

## Class PerforceInfoCommand

- java.lang.Object
- - org.apache.maven.scm.command.AbstractCommand
  - - org.apache.maven.scm.provider.perforce.command.PerforceInfoCommand

- All Implemented Interfaces:
    Command, PerforceCommand

      public class PerforceInfoCommand
      extends AbstractCommand
      implements PerforceCommand

  Encapsulates the 'p4 info' command which can be very useful in determining the runtime environment. Use `getEntry(String key)` to query the info set for a particular property. The data from p4 info looks like this:

       User name: mperham
       Client name: mikeperham-dt
       Client host: mikeperham-dt
       Client root: d:\perforce

  where the key is the content before the first colon and the value is the data after the first colon, trimmed. For example: `PerforceInfoCommand.getInfo( this, repo ).getEntry( "User name" )`

  Note that this is not a traditional SCM command. This uses the Command class simply because it needs a logger for error handling and the current repository data for command line creation.
  Version:
    $Id: $
  Author:
    mperham

- - ### Field Summary

    - ### Fields inherited from interface org.apache.maven.scm.command.Command

      `ROLE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PerforceInfoCommand()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ScmResult` | `executeCommand(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters)`
    `String` | `getEntry(String key)`
    `static PerforceInfoCommand` | `getInfo(ScmLogger logger, PerforceScmProviderRepository repo)`

    - ### Methods inherited from class org.apache.maven.scm.command.AbstractCommand

      `execute, getLogger, setLogger`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PerforceInfoCommand

          public PerforceInfoCommand()

  - ### Method Detail

    - #### getInfo

          public static PerforceInfoCommand getInfo(ScmLogger logger,
                                    PerforceScmProviderRepository repo)

    - #### getEntry

          public String getEntry(String key)

    - #### executeCommand

          protected ScmResult executeCommand(ScmProviderRepository repo,
                                 ScmFileSet scmFileSet,
                                 CommandParameters commandParameters)
                                      throws ScmException

      Specified by:
        `executeCommand` in class `AbstractCommand`
      Throws:
        `ScmException`

Copyright © 2003–2015. All rights reserved.