Class PerforceInfoCommand
java.lang.Object
org.apache.maven.scm.command.AbstractCommand
org.apache.maven.scm.provider.perforce.command.PerforceInfoCommand
- All Implemented Interfaces:
Command
,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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ScmResult
executeCommand
(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters) static PerforceInfoCommand
getInfo
(ScmLogger logger, PerforceScmProviderRepository repo) private static PerforceInfoCommand
getSingleton
(ScmLogger logger, PerforceScmProviderRepository repo) Methods inherited from class org.apache.maven.scm.command.AbstractCommand
execute, getLogger, setLogger
-
Field Details
-
singleton
-
entries
-
-
Constructor Details
-
PerforceInfoCommand
public PerforceInfoCommand()
-
-
Method Details
-
getInfo
-
getEntry
-
getSingleton
private static PerforceInfoCommand getSingleton(ScmLogger logger, PerforceScmProviderRepository repo) -
executeCommand
protected ScmResult executeCommand(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters) throws ScmException - Specified by:
executeCommand
in classAbstractCommand
- Throws:
ScmException
-