Perforce Utilities Project

About This Project

Content

Source, documentation, and JAR for P4Package, a high-level Java API for Perforce. These classes provide a way to encapsulate source control objects like branches, files, users, etc. I've had a lot of success building tools and scripts based on these classes. Because of the encapsulation, maintenance is much simpler. When perforce changes, only these underlying classes need to be updated.

$cott Money and I presented a paper that discussed some of the tools built on these classes during the 2000 Perforce User Conference. It only took a year to make these available. Sorry for the wait. I promise to ensure any contributions are incorporated quickly.

Curators

David Markley and Sivananda Poreddy. Please email david@markley.cc and sporeddy@quinstreet.com if you have submitted contributions you'd like published, have ideas for enhancement, or have preferences among the potential enhancements listed below.

Getting Started

Take a look at the examples and API documentation. These should help you get an idea of how to use the package. To build the examples, you must:

  • Download the latest JAR file and put it on your CLASSPATH.
  • Download all the .java files and the p4.properties file.
  • Modify the p4.properties file to fit your environment.
  • Modify the example .java files to fit your needs.
  • Compile all the .java files using 'javac *.java'
  • Execute an example with something like 'java ListUsers'
Related Projects

These projects are built upon this Java API.

  • p4jsp - a JSP based web application for browsing and interacting with Perforce.
  • Java Reviewer - an extensible Java based Perforce reviewer.

Project Updates

Date Update
November 5, 2001 Initial publication of P4Package.
December 4, 2001
  • Added some example code.
  • Added a server timeout threshold to the P4Process and Env classes.
January 15, 2002
  • Added more example code.
  • Added the Counter class.
  • Corrected the filelog methods for the FileEntry class.
August 5, 2002
  • Fixed the Label class to report all labels properly.
  • Fixed the JobField class to load field information correctly.
  • Fixed the Job class to list all jobs, and to correctly identify fixes.