public class PrintDelegator extends BaseDelegator implements IPrintDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION
Constructor and Description |
---|
PrintDelegator(IOptionsServer server)
Instantiate a new PrintDelegator, providing the server object that will be used to
execute Perforce Helix attribute commands.
|
Modifier and Type | Method and Description |
---|---|
void |
getFileContents(java.nio.ByteBuffer byteBufferContent,
java.util.List<IFileSpec> fileSpecs,
GetFileContentsOptions opts)
Saves the value of a ByteBuffer onto the contents of one or more Perforce depot
file contents.
|
java.io.InputStream |
getFileContents(java.util.List<IFileSpec> fileSpecs,
boolean allRevs,
boolean noHeaderLine) |
java.io.InputStream |
getFileContents(java.util.List<IFileSpec> fileSpecs,
GetFileContentsOptions opts)
Return an InputStream onto the contents of one or more revisions of one or more Perforce depot
file contents.
|
public PrintDelegator(IOptionsServer server)
server
- a concrete implementation of a Perforce Helix Serverpublic java.io.InputStream getFileContents(java.util.List<IFileSpec> fileSpecs, boolean allRevs, boolean noHeaderLine) throws ConnectionException, RequestException, AccessException
getFileContents
in interface IPrintDelegator
ConnectionException
RequestException
AccessException
public java.io.InputStream getFileContents(java.util.List<IFileSpec> fileSpecs, GetFileContentsOptions opts) throws P4JavaException
IPrintDelegator
If file is specified as a Perforce client workspace file name, the client view is used to find the corresponding depot file. If a file argument has a revision, then all files as of that revision are streamed. If a file argument has a revision range, then only files selected by that revision range are streamed, and the highest revision in the range is used for each file. Normally, only the head revision is printed.
The underlying input stream is not guaranteed to support mark() and skip() operations, and in some cases can be absolutely ginormously long it is also not guaranteed to be printable, and will be in the charset encoding stored in the Perforce server.
You should close the InputStreamReader after use in order to release any underlying stream-related resources. Failure to do this may lead to the proliferation of temp files or long-term memory wastage or even leaks.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getFileContents
in interface IPrintDelegator
fileSpecs
- non-null list of depot or client file specs defining files to be streamedopts
- GetFileContentsOptions object describing optional parameters; if null, no
options are set.P4JavaException
- if any error occurs in the processing of this method.public void getFileContents(java.nio.ByteBuffer byteBufferContent, java.util.List<IFileSpec> fileSpecs, GetFileContentsOptions opts) throws java.lang.Exception
IPrintDelegator
If file is specified as a Perforce client workspace file name, the client view is used to find the corresponding depot file.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getFileContents
in interface IPrintDelegator
byteBufferContent
- Fills with content of the fileSpecs into a ByteBufferfileSpecs
- non-null list of depot or client file specs defining files to be streamedopts
- GetFileContentsOptions object describing optional parameters; if null, no
options are set.P4JavaException
- if any error occurs in the processing of this method.java.lang.Exception