public class Diff2Delegator extends BaseDelegator implements IDiff2Delegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION
Constructor and Description |
---|
Diff2Delegator(IOptionsServer server)
Instantiate a new Diff2Delegator, providing the server object that will be used to
execute Perforce Helix attribute commands.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<IFileDiff> |
getFileDiffs(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
DiffType diffType,
boolean quiet,
boolean includeNonTextDiffs,
boolean gnuDiffs)
Run diff on the Perforce server of two files in the depot.
|
java.util.List<IFileDiff> |
getFileDiffs(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
GetFileDiffsOptions opts)
Run diff on the Perforce server of two files in the depot.
|
java.io.InputStream |
getFileDiffsStream(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
GetFileDiffsOptions opts)
Run diff on the Perforce server of two files in the depot.
|
java.io.InputStream |
getServerFileDiffs(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
DiffType diffType,
boolean quiet,
boolean includeNonTextDiffs,
boolean gnuDiffs)
Run diff on the Perforce server of two files in the depot.
|
public Diff2Delegator(IOptionsServer server)
server
- a concrete implementation of a Perforce Helix Serverpublic java.util.List<IFileDiff> getFileDiffs(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, GetFileDiffsOptions opts) throws P4JavaException
IDiff2Delegator
With a branch view, fromFile and toFile are optional; fromFile limits the scope of the source file set, and toFile limits the scope of the target. If only one file argument is given, it is assumed to be toFile.
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics.
getFileDiffs
in interface IDiff2Delegator
file1
- (optional, with a branch view) source file IFileSpecfile2
- (optional, with a branch view) target file IFileSpecbranchSpecName
- optional branch spec nameopts
- GetFileDiffsOptions object describing optional parameters; if null, no
options are set.P4JavaException
- if an error occurs processing this method and its parameters.public java.util.List<IFileDiff> getFileDiffs(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, DiffType diffType, boolean quiet, boolean includeNonTextDiffs, boolean gnuDiffs) throws ConnectionException, RequestException, AccessException
IDiff2Delegator
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics. In particular, the various potentially-valid combinations of branch spec and file specs can be complicated and won't be repeated here.
getFileDiffs
in interface IDiff2Delegator
file1
- optional first file IFileSpecfile2
- optional second file IFileSpecbranchSpecName
- optional branch spec namediffType
- diff typequiet
- if true, suppresses the display of the header lines of files
whose content and types are identical and suppresses the
actual diff for all files.includeNonTextDiffs
- if true, forces 'p4 diff2' to diff even files with non-text
(binary) typesgnuDiffs
- see "-u" option in the main diff2 documentation.ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.io.InputStream getFileDiffsStream(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, GetFileDiffsOptions opts) throws P4JavaException
IDiff2Delegator
With a branch view, fromFile and toFile are optional; fromFile limits the scope of the source file set, and toFile limits the scope of the target. If only one file argument is given, it is assumed to be toFile.
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics.
As with other streams-based IServer methods, callers should ensure that the stream returned here is always explicitly closed after use; if not closed, the stream's associated temporary files managed by P4Java (if they exist) may not be properly deleted.
getFileDiffsStream
in interface IDiff2Delegator
file1
- (optional, with a branch view) source file IFileSpecfile2
- (optional, with a branch view) target file IFileSpecbranchSpecName
- optional branch spec nameopts
- GetFileDiffsOptions object describing optional parameters; if null, no
options are set.P4JavaException
- if an error occurs processing this method and its parameters.public java.io.InputStream getServerFileDiffs(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, DiffType diffType, boolean quiet, boolean includeNonTextDiffs, boolean gnuDiffs) throws ConnectionException, RequestException, AccessException
IDiff2Delegator
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics. In particular, the various potentially-valid combinations of branch spec and file specs can be complicated and won't be repeated here.
As with other streams-based IServer methods, callers should ensure that the stream returned here is always explicitly closed after use; if not closed, the stream's associated temporary files managed by P4Java (if they exist) may not be properly deleted.
getServerFileDiffs
in interface IDiff2Delegator
file1
- optional first file IFileSpecfile2
- optional second file IFileSpecbranchSpecName
- optional branch spec namediffType
- diff typequiet
- if true, suppresses the display of the header lines of files
whose content and types are identical and suppresses the
actual diff for all files.includeNonTextDiffs
- if true, forces 'p4 diff2' to diff even files with non-text
(binary) typesgnuDiffs
- see "-u" option in the main diff2 documentation.ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the caller