Jump to content


Error messages in InputStream returned from IServer.getFileContents

java p4java perforce-api

  • Please log in to reply
2 replies to this topic

#1 jkahrman

jkahrman

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 06 February 2015 - 10:40 PM

I just updated p4java-2014.1.965322 and IServer.getFileContents is now returning error messages in the InputStream when the file does not exist. It previously had been returning null, which I was using to fall back to a different filespec, and then a null object. Shouldn't errors like the following be coming back as exceptions? Why are they in the input stream representing the contents of the file?

//mw/Btools/config/branch/snap/Btools@0 - no file(s) as of that date.

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 12 February 2015 - 08:51 PM

Thank you for the error message example. I have seen this error message reported once and it was caused by the command syntax when there were preceding/trailing spaces involved. We do not have enough information to say for sure what is causing your errors but here are some troubleshooting questions:

- What was the exact command that was run which produced this error message?

- Are there any spaces preceding or trailing at the end of a command using an '@' symbol?

For example, if by accident someone adds a space after a changelist number, it can trigger this type of message:

p4 files "what.html@400001 "

The @<anything> can specify a changelist number, a data, a label name, or a client name. In this case because you have numbers, the system will find the changelist but the space will be interpreted by the DateTime parser as a date/time. Thus make sure to remove any preceding/trailing spaces.

#3 jkahrman

jkahrman

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 February 2015 - 04:49 PM

I'm not asking how the error occurred, I'm asking why it's coming back in the input stream that is supposed to be representing the contents of the file.

I just updated p4java-2014.1.965322 and IServer.getFileContents API is now returning error messages in the InputStream when the file does not exist. It previously had been returning null, which I was using to fall back to a different filespec, and then a null object. Shouldn't errors like the following be coming back as exceptions? Why are they in the input stream representing the contents of the file?

//mw/Btools/config/branch/snap/Btools@0 - no file(s) as of that date.





Also tagged with one or more of these keywords: java, p4java, perforce-api

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users