public class PerforceInfoCommand extends AbstractCommand implements PerforceCommand
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:\perforcewhere 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.Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
entries |
private static PerforceInfoCommand |
singleton |
Constructor and Description |
---|
PerforceInfoCommand() |
Modifier and Type | Method and Description |
---|---|
protected ScmResult |
executeCommand(ScmProviderRepository repo,
ScmFileSet scmFileSet,
CommandParameters commandParameters) |
java.lang.String |
getEntry(java.lang.String key) |
static PerforceInfoCommand |
getInfo(ScmLogger logger,
PerforceScmProviderRepository repo) |
private static PerforceInfoCommand |
getSingleton(ScmLogger logger,
PerforceScmProviderRepository repo) |
execute, getLogger, setLogger
private static PerforceInfoCommand singleton
private java.util.Map<java.lang.String,java.lang.String> entries
public static PerforceInfoCommand getInfo(ScmLogger logger, PerforceScmProviderRepository repo)
public java.lang.String getEntry(java.lang.String key)
private static PerforceInfoCommand getSingleton(ScmLogger logger, PerforceScmProviderRepository repo)
protected ScmResult executeCommand(ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters) throws ScmException
executeCommand
in class AbstractCommand
ScmException