<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <title>Perforce Java API Package</title> </head> <body bgcolor="white"> Provides classes for accessing Perforce objects (<a href="doc-files/LICENSE.TXT"><font color="red"><b>LICENSE</b></font></a>). These classes can be used to write higher-level scripts and applications in Java, which is the definition of an API. <p> This software is provided <a href="doc-files/LICENSE.TXT"><font color="red"><b>'AS IS' with NO WARRANTY!</b></font></a> <p> The current implementation acts as a wrapper around the execution of command line requests. There has been some development done in an attempt to utilize the P4API directly through the Java Native Interface. When this work is completed, it will be possible convert to its use without changing the underlying objects. <h2>Usage Overview</h2> The key classes in this package are {@link com.perforce.api.Env Env} and {@link com.perforce.api.P4Process P4Process}. All the remaining object representation rely on these two. The <code>Env</code> must be instantiated and configured before using it with other classes. The <code>P4Process</code> may never be instantiated directly, but it is where the actual command is executed. This is extremely useful, if the classes provided do not provide the functionality you need. <h3>Example</h3> In this example, the method performs and integration and commits the change. <pre> public void doIt() { {@link com.perforce.api.Env Env} env; {@link com.perforce.api.Change Change} chng; StringBuffer sb; env = new Env(); env.setUser("jdoe"); env.setPassword("secret"); env.setClient("jdoe-pc"); chng = new Change(env); chng.setDescription("Integration from staging to release."); try { chng.store(); sb = new StringBuffer(); chng = {@link com.perforce.api.Branch Branch}.{@link com.perforce.api.Branch#integrate(Env, String, String, StringBuffer, Change) integrate}(env, "//depot/docs/stage/...", "stage2release", sb, chng); chng.submit(); } catch (CommitException e) { System.err.println("Unable to store new change."); } catch (SubmitException e) { System.err.println("Unable to submit changelist into Perforce."); } catch (PerforceException e) { System.err.println("Unable to integrate files: "+sb); } } </pre> <i>Last Updated: $Date: 2001/11/05 $ $Revision: #2 $</i> @see <a href="doc-files/LICENSE.TXT"><font color="red"><b>LICENSE<b></font></a> <!-- <h2>Package Specification</h2> ##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT ##### <ul> <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a> </ul> --> <!-- Put @see and @since tags down here. --> </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1035 | David Markley | Changed the file type to provide for keyword expansion. | ||
#1 | 1034 | David Markley |
Added P4Package sources as subset of the P4WebPublisher project. Copyright (c) 2001, Perforce Software, All rights reserved. |