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.- Author:
- mperham
-
-
Constructor Summary
Constructors Constructor Description PerforceInfoCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ScmResultexecuteCommand(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters)java.lang.StringgetEntry(java.lang.String key)static PerforceInfoCommandgetInfo(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)
-
getEntry
public java.lang.String getEntry(java.lang.String key)
-
executeCommand
protected ScmResult executeCommand(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters) throws ScmException
- Specified by:
executeCommandin classAbstractCommand- Throws:
ScmException
-
-