Interface IPrintDelegator

    • Method Detail

      • getFileContents

        java.io.InputStream getFileContents​(java.util.List<IFileSpec> fileSpecs,
                                            GetFileContentsOptions opts)
                                     throws P4JavaException
        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....

        Parameters:
        fileSpecs - non-null list of depot or client file specs defining files to be streamed
        opts - 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

        void getFileContents​(java.nio.ByteBuffer byteBufferContent,
                             java.util.List<IFileSpec> fileSpecs,
                             GetFileContentsOptions opts)
                      throws java.lang.Exception
        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....

        Parameters:
        byteBufferContent - Fills with content of the fileSpecs into a ByteBuffer
        fileSpecs - non-null list of depot or client file specs defining files to be streamed
        opts - 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