Class PrintDelegator
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
-
- com.perforce.p4java.impl.mapbased.server.cmd.PrintDelegator
-
- All Implemented Interfaces:
IPrintDelegator
public class PrintDelegator extends BaseDelegator implements IPrintDelegator
Implementation to handle the Print command.
-
-
Field Summary
-
Fields inherited from class com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION
-
-
Constructor Summary
Constructors Constructor Description PrintDelegator(IOptionsServer server)
Instantiate a new PrintDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
PrintDelegator
public PrintDelegator(IOptionsServer server)
Instantiate a new PrintDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.- Parameters:
server
- a concrete implementation of a Perforce Helix Server
-
-
Method Detail
-
getFileContents
public java.io.InputStream getFileContents(java.util.List<IFileSpec> fileSpecs, boolean allRevs, boolean noHeaderLine) throws ConnectionException, RequestException, AccessException
- Specified by:
getFileContents
in interfaceIPrintDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
getFileContents
public java.io.InputStream getFileContents(java.util.List<IFileSpec> fileSpecs, GetFileContentsOptions opts) throws P4JavaException
Description copied from interface:IPrintDelegator
Return an InputStream onto the contents of one or more revisions of one or more Perforce depot file contents.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....
- Specified by:
getFileContents
in interfaceIPrintDelegator
- Parameters:
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.- Returns:
- a non-null but possibly-empty InputStream onto the file / revision contents.
- Throws:
P4JavaException
- if any error occurs in the processing of this method.
-
getFileContents
public void getFileContents(java.nio.ByteBuffer byteBufferContent, java.util.List<IFileSpec> fileSpecs, GetFileContentsOptions opts) throws java.lang.Exception
Description copied from interface:IPrintDelegator
Saves the value of a ByteBuffer onto the contents of one or more Perforce depot file contents.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....
- Specified by:
getFileContents
in interfaceIPrintDelegator
- Parameters:
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.- Throws:
P4JavaException
- if any error occurs in the processing of this method.java.lang.Exception
-
-