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. UsegetEntry(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
-
-
Constructor Summary
Constructors Constructor Description PerforceInfoCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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
-
-
-
-
Method Detail
-
getInfo
public static PerforceInfoCommand getInfo(ScmLogger logger, PerforceScmProviderRepository repo)
-
executeCommand
protected ScmResult executeCommand(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters) throws ScmException
- Specified by:
executeCommand
in classAbstractCommand
- Throws:
ScmException
-
-