1. /*
  2. * Copyright 2000-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. /*
  18. * Portions of this software are based upon public domain software
  19. * originally written at the National Center for Supercomputing Applications,
  20. * University of Illinois, Urbana-Champaign.
  21. */
  22. package org.apache.tools.ant.taskdefs.optional.perforce;
  23. import org.apache.tools.ant.BuildException;
  24. /** Lists Perforce files currently on client.
  25. *
  26. * P4Have simply dumps the current file version info into
  27. * the Ant log (or stdout).
  28. *
  29. * @ant.task category="scm"
  30. */
  31. public class P4Have extends P4Base {
  32. /**
  33. * Execute the Perforce <code>have</code> command.
  34. *
  35. * @throws BuildException if the command cannot be executed.
  36. */
  37. public void execute() throws BuildException {
  38. execP4Command("have " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler(this));
  39. }
  40. }