public interface AQPerforce extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
add(Object files)
Open one or more Perforce client workspace files for adding to the Perforce server.
|
void |
close()
Disconnects the object from Perforce server.
|
void |
connect(String url,
String client,
String folder,
Object username,
Object password)
Establishes connection to the perforce server.
|
void |
connect(String url,
String client,
String folder,
Object username,
Object password,
String charset)
Establishes connection to the perforce server.
|
List<com.perforce.p4java.core.file.IFileSpec> |
deleteFiles(Object files,
int changeListId,
boolean noUpdate)
Open a Perforce client workspace file(s) for deletion from a Perforce depot.
|
void |
edit(Object files)
Open one or more Perforce client workspace files for editing.
|
com.perforce.p4java.client.IClient |
getClient(String name)
Get an
IClient object for a specific named Perforce client. |
List<com.perforce.p4java.client.IClientSummary> |
getClients(String userName,
String queryString,
int maxResults)
Get a list of IClientSummary objects for all Perforce clients known to this Perforce server.
|
List<com.perforce.p4java.core.file.IFileSpec> |
getDepotFiles(Object files,
boolean allRevs)
List all Perforce depot files known to the Perforce server that conform to the passed-in wild-card file specification(s).
|
List<com.perforce.p4java.core.IDepot> |
getDepots()
Get a list of all Perforce depots known to this Perforce server.
|
List<com.perforce.p4java.core.file.IFileSpec> |
getDiffFiles(Object files,
boolean diffNonTextFiles,
boolean openedDifferentMissing,
boolean openedForIntegrate,
boolean unopenedMissing,
boolean unopenedDifferent,
boolean unopenedWithStatus,
boolean openedSame)
Return a list of files that differ in some (arbitrarily complex) way from depot.
|
String[] |
getDirectories(Object files,
boolean clientOnly,
boolean deletedOnly,
boolean haveListOnly)
List any directories matching the passed-in file specifications.
|
AQRevision[] |
getHistory(String filename)
Returns the file's complete revision history.
|
AQRevision[] |
getHistory(String filename,
int count)
Returns the file's revision history.
|
AQRevision |
getRevision(String filename)
Returns the file revision.
|
byte[] |
getRevisionContents(String filename,
String revision)
Returns the binary contents of the specified revision.
|
com.perforce.p4java.server.IServerInfo |
getServerInfo()
Returns a snapshot set of data on the Perforce server associated with this server interface.
|
com.perforce.p4java.core.IUser |
getUser(String name)
Get the user details of a specific Perforce user from the Perforce server.
|
com.perforce.p4java.core.IUserGroup |
getUserGroup(String name)
Get the named Perforce user group.
|
List<com.perforce.p4java.core.IUserGroup> |
getUserGroups(String userOrGroupName,
boolean indirect,
boolean displayValues)
Get a list of Perforce user groups from the server.
|
List<com.perforce.p4java.core.IUserSummary> |
getUsers()
Get a list of Perforce users known to this Perforce server.
|
List<com.perforce.p4java.core.file.IFileSpec> |
haveList(Object files)
Return a list of all Perforce-managed files and versions that the Perforce server believes this Perforce
client workspace has as of the latest sync.
|
List<com.perforce.p4java.core.file.IFileSpec> |
lockFiles(Object files,
int changeListId)
Lock an opened file against changelist submission.
|
List<com.perforce.p4java.core.file.IFileSpec> |
moveFile(int changelistId,
boolean listOnly,
boolean noClientMove,
String fileType,
String fromFile,
String toFile)
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile).
|
void |
revert(Object files)
Revert an open Perforce client workspace file back to the revision previously synced from the Perforce depot,
discarding any pending changelists or integrations that have been made so far.
|
void |
setVerbose(boolean verbose)
Sets the amount of diagnostic messages sent to the debugger console.
|
void |
submit(Object files,
String comment)
This method submits changes in the specified file(s) or folder(s)
to the Perforce revision control system.
|
void |
sync(Object files)
This method syncs the local filesystem with the latest Perforce revision.
|
List<com.perforce.p4java.core.file.IFileSpec> |
unlockFiles(Object files,
int changeListId,
boolean force)
Release locked files but leave them open.
|
void setVerbose(boolean verbose)
verbose
- (Default value - true).void connect(String url, String client, String folder, Object username, Object password) throws Exception
url
- Server URL string.client
- Perforce workspace client name.folder
- Filesystem folder under Perforce revision control.username
- A String
or a AQOpaqueObject
containing the user name.password
- A String
password or a AQOpaqueObject
containing the password.Exception
- On errorvoid connect(String url, String client, String folder, Object username, Object password, String charset) throws Exception
url
- Server URL string.client
- Perforce workspace client name.folder
- Filesystem folder under Perforce revision control.username
- A String
or a AQOpaqueObject
containing the user name.password
- A String
password or a AQOpaqueObject
containing the password.charset
- A String
or a AQOpaqueObject
containing the charset.Exception
- On errorvoid close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
- On errorvoid submit(Object files, String comment) throws Exception
files
- A file name, or a javascript array of file names.comment
- The commentException
- On errorvoid sync(Object files) throws Exception
files
- A file name, or a javascript array of file names.Exception
- On errorvoid edit(Object files) throws Exception
files
- A file name, or a javascript array of file names.Exception
- On errorvoid add(Object files) throws Exception
files
- A file name, or a javascript array of file names.Exception
- On errorvoid revert(Object files) throws Exception
files
- A file name, or a javascript array of file names.Exception
- On errorAQRevision getRevision(String filename) throws Exception
filename
- Workspace file name.Exception
- On errorAQRevision[] getHistory(String filename) throws Exception
filename
- Workspace file name.Exception
- On errorAQRevision[] getHistory(String filename, int count) throws Exception
filename
- Workspace file name.count
- Maximum number of revisions to return.Exception
- On errorbyte[] getRevisionContents(String filename, String revision) throws Exception
filename
- Workspace file name.revision
- Revision number or "head" for head revision or "have" for have revision.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> deleteFiles(Object files, int changeListId, boolean noUpdate) throws Exception
files
- A file name, or a javascript array of file names.changeListId
- If positive, the opened files are put into the pending changelist identified by changeListId; this changelist must have been
previously created. If zero or negative, the file is opened in the 'default' (unnumbered) changelist.noUpdate
- If true, don't actually do the open, just return the files that would have been opened for deletion.IFileSpec
objects representing the opened files.
Not all fields in these specs will be valid or set.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> moveFile(int changelistId, boolean listOnly, boolean noClientMove, String fileType, String fromFile, String toFile) throws Exception
changelistId
- If not IChangelist.UNKNOWN, the files are opened in the numbered pending changelist instead of the 'default' changelist.listOnly
- If true, don't actually perform the move, just return what would happen if the move was performed.noClientMove
- If true, bypasses the client file rename. This option can be used to tell the server that the user has already renamed a file on
the client. The use of this option can confuse the server if you are wrong about the client's contents. Only works for 2009.2 and
later servers; earlier servers will produce a RequestException if you set this true.fileType
- If not null, the file is reopened as that filetype.fromFile
- The original file; must be already open for edit.toFile
- The target file.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> lockFiles(Object files, int changeListId) throws Exception
The open files named are locked in the Perforce depot, preventing any user other than the current user on the current client from submitting changes to the files. If a file is already locked then the lock request is rejected. If no file specs are given then lock all files currently open in the changelist number given if it is IChangelist.DEFAULT or > 0.
files
- A file name, or a javascript array of file names.changeListId
- If IChangelist.DEFAULT or larger than zero, lock all files associated this changelist ID.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> unlockFiles(Object files, int changeListId, boolean force) throws Exception
If the files are open in a specific pending changelist other than 'default', then the changeListId parameter is required to specify the pending changelist. If no file name is given then all files in the designated changelist are unlocked.
files
- A file name, or a javascript array of file names.changeListId
- If IChangelist.DEFAULT or larger than zero, lock all files associated this changelist ID.force
- Force the lock on non-owned filespecs. Requires appropriate permissions.Exception
- On errorList<com.perforce.p4java.client.IClientSummary> getClients(String userName, String queryString, int maxResults) throws Exception
userName
- If not null, restrict listings to clients owned by the user 'userName'.queryString
- If not null, limits output to clients whose name matches the query pattern passed-in.
Note this option does not work for earlier Perforce servers.maxResults
- If > 0, restrict output to the first maxResults results.IClientSummary
objects for Perforce clients known to this Perforce server.Exception
- On errorcom.perforce.p4java.client.IClient getClient(String name) throws Exception
IClient
object for a specific named Perforce client.name
- A non-null Perforce client name.IClient
representing the specified Perforce client, or null if no such client.Exception
- On errorList<com.perforce.p4java.core.IUserSummary> getUsers() throws Exception
IUserSummary
objects representing the underlying Perforce users (if any).Exception
- On errorcom.perforce.p4java.core.IUser getUser(String name) throws Exception
name
- If null, get the current user details, otherwise use the passed-in user name.IUser
details for the user, or null if no such user is known.Exception
- On errorList<com.perforce.p4java.core.IDepot> getDepots() throws Exception
IDepot
objects representing the underlying Perforce depots.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> getDiffFiles(Object files, boolean diffNonTextFiles, boolean openedDifferentMissing, boolean openedForIntegrate, boolean unopenedMissing, boolean unopenedDifferent, boolean unopenedWithStatus, boolean openedSame) throws Exception
files
- A file name, or a javascript array of file names.diffNonTextFiles
- Include non-text files in the diff lists.openedDifferentMissing
- Corresponds to the "-sa" option for the p4 command line.openedForIntegrate
- Corresponds to the "-sb" option for the p4 command line.unopenedMissing
- Corresponds to the "-sd" option for the p4 command line.unopenedDifferent
- Corresponds to the "-se" option for the p4 command line.unopenedWithStatus
- Corresponds to the "-sl" option for the p4 command line.openedSame
- Corresponds to the "-sr" option for the p4 command line.Exception
- On errorString[] getDirectories(Object files, boolean clientOnly, boolean deletedOnly, boolean haveListOnly) throws Exception
files
- A file name, or a javascript array of file names.clientOnly
- If true, limit the returns to directories that are mapped in the current Perforce client workspace.deletedOnly
- If true, includes directories with only deleted files.haveListOnly
- If true, lists directories of files on the 'have' list.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> getDepotFiles(Object files, boolean allRevs) throws Exception
If client file names are given as file spec arguments the current Perforce client view mapping is used to list the corresponding depot files, if the client and view exist (if not, the results are undefined).
Normally, the head revision of each matching file is listed, but you can change this by specifying specific revisions or revision ranges. If the file spec argument includes a revision, then all files as of that revision are returned. If the file spec argument has a revision range, then only files selected by that revision range are returned, and the highest revision in the range is used for each file. If allRevs is true, all revisions within the specific range, rather than just the highest revision in the range, are returned.
See 'p4 help revisions' for help specifying revisions.
files
- A file name, or a javascript array of file names.allRevs
- If true, list all revisions of qualifying files.Exception
- On errorcom.perforce.p4java.core.IUserGroup getUserGroup(String name) throws Exception
name
- Non-null group name.IUserGroup
representing the named user group if it exists on the server;
null otherwise (but see note in main comments above which make no sense, frankly).Exception
- On errorList<com.perforce.p4java.core.IUserGroup> getUserGroups(String userOrGroupName, boolean indirect, boolean displayValues) throws Exception
Note that the Perforce server considers it an error to have both indirect and displayValues parameters set true; this will cause the server to throw a RequestException with an appropriate usage message.
userOrGroupName
- If non-null, restrict the list to the specified group or username.indirect
- If true, also displays groups that the specified user or group belongs to indirectly via subgroups.displayValues
- If true, display the MaxResults, MaxScanRows, MaxLockTime, and Timeout values for the named group.Exception
- On errorList<com.perforce.p4java.core.file.IFileSpec> haveList(Object files) throws Exception
files
- A file name, or a javascript array of file names.Exception
- On error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.