org.apache.maven.scm.provider.perforce.command

## Class PerforceWhereCommand

- java.lang.Object
- - org.apache.maven.scm.provider.perforce.command.PerforceWhereCommand

-     public class PerforceWhereCommand
      extends Object

  Encapsulates the 'p4 where' command which can be very useful in determining a file's location within the depot. Use `getDepotLocation(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

  Version:
    $Id: $
  Author:
    mperham

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PerforceWhereCommand(ScmLogger log, PerforceScmProviderRepository repos)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDepotLocation(File file)`
    `String` | `getDepotLocation(String filepath)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PerforceWhereCommand

          public PerforceWhereCommand(ScmLogger log,
                              PerforceScmProviderRepository repos)

  - ### Method Detail

    - #### getDepotLocation

          public String getDepotLocation(File file)

    - #### getDepotLocation

          public String getDepotLocation(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.

Copyright © 2003–2015. All rights reserved.