Interface IGrepDelegator

All Known Subinterfaces:
IOptionsServer, IServer, IStreamingServer
All Known Implementing Classes:
GrepDelegator, NtsServerImpl, OneShotServerImpl, RpcServer, Server

public interface IGrepDelegator
The Interface for 'p4 grep' implementations.
  • Method Details

    • getMatchingLines

      List<IFileLineMatch> getMatchingLines(List<IFileSpec> fileSpecs, String pattern, MatchingLinesOptions options) throws P4JavaException
      Get list of matching lines in the specified file specs. This method implements the p4 grep command; for full semantics, see the separate p4 documentation and / or the GrepOptions Javadoc.
      Parameters:
      fileSpecs - file specs to search for matching lines
      pattern - non-null string pattern to be passed to the grep command
      options - - Options to grep command
      Returns:
      - non-null but possibly empty list of file line matches
      Throws:
      P4JavaException - if any error occurs in the processing of this method.
    • getMatchingLines

      List<IFileLineMatch> getMatchingLines(@Nonnull List<IFileSpec> fileSpecs, @Nonnull String pattern, @Nullable List<String> infoLines, MatchingLinesOptions options) throws P4JavaException
      Get list of matching lines in the specified file specs. This method implements the p4 grep command; for full semantics, see the separate p4 documentation and / or the GrepOptions Javadoc.

      This method allows the user to retrieve useful info and warning message lines the Perforce server may generate in response to things like encountering a too-long line, etc., by passing in a non-null infoLines parameter.

      Parameters:
      fileSpecs - file specs to search for matching lines
      pattern - non-null string pattern to be passed to the grep command
      infoLines - if not null, any "info" lines returned from the server (i.e. warnings about exceeded line lengths, etc.) will be put into the passed-in list in the order they are received.
      options - - Options to grep command
      Returns:
      - non-null but possibly empty list of file line matches
      Throws:
      P4JavaException - if any error occurs in the processing of this method.
      Since:
      2011.1