Class PerforceWhereCommand
- java.lang.Object
-
- org.apache.maven.scm.provider.perforce.command.PerforceWhereCommand
-
public class PerforceWhereCommand extends java.lang.Object
Encapsulates the 'p4 where' command which can be very useful in determining a file's location within the depot. UsegetDepotLocation(String path)
to query the depot location for a particular file. The data from p4 where looks like this:p4 where pom.xml //depot/modules/fabric/trunk/pom.xml //mikeperham-dt/depot/modules/fabric/trunk/pom.xml d:\perforce\depot\modules\fabric\trunk\pom.xml
-
-
Field Summary
Fields Modifier and Type Field Description private ScmLogger
logger
private PerforceScmProviderRepository
repo
-
Constructor Summary
Constructors Constructor Description PerforceWhereCommand(ScmLogger log, PerforceScmProviderRepository repos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDepotLocation(java.io.File file)
java.lang.String
getDepotLocation(java.lang.String filepath)
-
-
-
Field Detail
-
logger
private ScmLogger logger
-
repo
private PerforceScmProviderRepository repo
-
-
Constructor Detail
-
PerforceWhereCommand
public PerforceWhereCommand(ScmLogger log, PerforceScmProviderRepository repos)
-
-
Method Detail
-
getDepotLocation
public java.lang.String getDepotLocation(java.io.File file)
-
getDepotLocation
public java.lang.String getDepotLocation(java.lang.String filepath)
- Parameters:
filepath
- an absolute file path- Returns:
- the absolute location of the given file within the Perforce repository or null if the file does not exist in a mapping within the current clientspec.
-
-