P4Java Changelog

What's new in P4Java 2014.1

Dec 3, 2014
  • Bugs fixed:
  • Fixed an issue where Label.isLocked() always returns false. This method pertains to the "locked/unlocked" label update option. Also, added a new method Label.isAutoReload() for the "autoreload/noautoreload" option.
  • Fixed a problem where P4Java returns "file does not exist" messages when syncing deleted files. The solution is to bypass the delete operation if the file doesn't exist.
  • Fixed an issue where P4Java does not capture output in local file syntax when running the 'p4 reconcile -l' command option. This option is set via the ReconcileFilesOptions.setLocalSyntax() method with 'true' as the input parameter value.
  • Fixed an issue where the p4trust file cannot be set using the "trustPath" or the long form "com.perforce.p4java.trustPath" property when requesting an IOptionServer from the ServerFactory.
  • Fixed a regression issue where the IFileSpec.getOriginalPath() returning null. Now, it will try to return the pseudo-type PathType.ORIGINAL path, if it is not null. Otherwise, it will return the PathType.CLIENT path.
  • Fixed an issue where malformed exclude protection entries occurring when the depot paths with whitespace are quoted. The IOptionsServer.updateProtectionEntries() method corresponds to the 'p4 protect -i' command.
  • Fixed an issue where unchanged large size files with Unicode chars showing as different on Windows using Perforce client charset 'utf8'. The IClient.getDiffFiles() method corresponds to the 'p4 diff -s' command.
  • Fixed a permissions issue with the Perforce tickets file in the Windows environment.
  • Fixed a problem with the IClient.reconcileFiles() method throwing an exception when file path contains whitespace. The MapEntry class requires double quotes to placed around file path with whitespace. This method corresponds to the 'p4 reconcile' command.
  • Fixed an issue with the Server.getFileContents() method returning null InputStream for non-existing file or revision. This method corresponds to the 'p4 print' command.
  • Major new functionality:
  • Added a new P4Java API method 'renameUser()' to IOptionsServer for completely renaming a user, modifying all database records which mention the user. This method corresponds to the 'p4 renameuser' command. This command requires 'super' access.
  • Added support for automatically detect and setup P4Java's Perforce client charset when connected to an Unicode enabled Perforce server. The automatic client charset is provided by the JVM and OS platform. If Perforce doesn't support the detected client charset it will default to 'utf8'.
  • Added a new P4Java API method 'getShelvedFiles()' to IOptionsServer for retrieving a list of shelved files from a pending change list. This method corresponds to the 'p4 describe -s -S ' command.
  • Added new P4Java API methods 'getTriggerEntries()', 'createTriggerEntries()' and 'updateTriggerEntries()' to IOptonsServer for retrieving and updating the Perforce triggers table. The methods correspond to the 'p4 triggers' command. This command requires 'super' access.
  • Minor new functionality:
  • Added the 'wipeAddFiles' option to RevertFilesOptions; causes files that are open for add to be deleted from the workspace when they are reverted. This option correspond to the '-w' flag in the 'p4 revert' command.
  • Added the 'outputDifferFilesOnly' option to GetFileDiffsOptions; limits output to files that differ. This option correspond to the '-Od' flag in the 'p4 diff2' command.
  • Added support for Greek character sets 'cp1253' (Windows Greek), 'cp737' (PC Greek), and 'iso8859-7' (Latin/Greek Alphabet).
  • Added a new method 'getServerCalendar()' to IServerInfo for retrieving the Perforce server date as a Calendar object, with the server timezone related information. For examples, '2014/06/05 10:28:16 -0700 PDT' and '2014/06/05 17:10:53 -0700 Pacific Daylight Time'.
  • Included the submitted 'time' in the FileSpec, accessible via the IFileSpec.getDate() method. The 'time' for each file is returned from the Perforce server when listing depot files using the optionsServer.getDepotFiles() method. This method corresponds to the 'p4 files' command.

New in P4Java 2013.2 (Oct 24, 2013)

  • Major new functionality in 2013.2:
  • Added a new P4Java API method 'getProtectionsTable()' to IOptionsServer to output the Perforce protections table. This corresponds to the 'p4 protect -o' command option. Note that after protections are defined, the 'p4 protect' command requires 'super' access.
  • Added a new P4Java API method 'submitShelvedChangelist()' to IClient to allow the submit of a shelved changelist without transferring files or modifying the workspace. This corresponds to the 'p4 submit -e shelvedChange#' command option. Note that the shelved changelist must be owned by the person submitting the change, but the client may be different. No files may be open in any workspace at the same changeless number.
  • Added a new P4Java API method 'getFileSizes()' to the IOptionsServer interface. This method will return a list of file sizes for one or more files in the depot. This corresponds to the 'p4 sizes' command.
  • Added a new P4Java API method 'journalWait()' to the IOptionsServer interface. This method turns on/off the journal-wait. The client application can specify "noWait" (off) replication when using a forwarding replica or an edge server. This corresponds to the deep undoc 'p4 journalwait [-i]' command.
  • Minor new functionality in 2013.2:
  • Added support for the 'IsUnloaded = 1' tagged output for the 'streams -U', 'clients -U' and 'labels -U' commands by implementing the isUnloaded() method on the IStreamSummary, IClientSummary and ILabelSummary interfaces.
  • Upgraded the JZlib compression library from version 1.1.1 to version 1.1.2. A list of changes can be viewed from the JZlib project website: http://www.jcraft.com/jzlib/ChangeLog
  • Added a method in the SymbolicLinkHelper class to get the last modified time of symlinks with non-existing targets. Note that it only works with symlink capable Java versions and systems.
  • Added the 'shortOutput' option to OpenedFilesOptions; produces optimized output when used with the -a (all clients) option. This option corresponds to the '-s' flag in the 'p4 opened' command.
  • Added support in ExtendedFileSpec for capturing propagating attributes and attribute types from the 'fstat -Oa' command output.
  • Added the 'groupName', 'userName' and 'ownerName' options to GetUserGroupsOptions; indicating that the 'name' argument is a(n) group/user/owner. These options correspond to the '-g', '-u' and '-o' flags in the 'p4 groups' command.
  • Added the 'suppressHeader' and 'showBinaryContent' options to GetFileAnnotationsOptions; suppresses the one-line header and displays the content of binary files. These options correspond to the '-q' and '-t' flags in the 'p4 annotate' command.
  • Bugs fixed in 2013.2:
  • Fixed an issue with P4Java not being able to add symlinks due to the missing 'xfiles' RPC protocol information. This occurs when the user is using a RPC socket connections pool.
  • Fixed an issue with P4Java not being able to add symlinks pointing to directories. P4Java mistakenly detecting these symlinks as real directories.
  • Fixed an issue with P4Java not being able to add/submit symlinks with non-existing targets.
  • Fixed an issue with P4Java using the wrong last modified time when adding a symlink that points to a directory. It was wrongly using the symlink target's last modified time.
  • Properly allowed P4Java's RPC sockets to be configured with user defined properties first before connecting to the server.
  • Updated P4Java to use a lowercase username to save and retrieve the auth ticket when connected to a case insensitive Perforce server.
  • Fixed an issue with P4Java when running 'resolve -at' of a symlink that points to a null reference (non-existing target).
  • Fixed an issue where FileAction.UNKNOWN.toString() throws a P4JavaError (name / ordinal mismatch).
  • Fixed an issue with P4Java when syncing a text file revision with the current local head revision as a symlink pointing to a non-existing target.
  • Fixed an issue with P4Java where binary files are corrupted in the Windows environment when sync is forced and the files are already in the have list.
  • Fixed an issue with the 'diff -sa' command (IClient.getDiffFiles()) returning results (filespecs), even though the content of the files were not modified. This happens when using a client workspace with the "LineEnd: win" spec running on the Mac/Linux/UNIX platforms.

New in P4Java 2013.1 (Aug 2, 2013)

  • Major new functionality:
  • Added support for unpacking the AppleSingle file format. This corresponds to the Perforce 'apple' file type. When syncing 'apple' type files, P4Java will extract the data fork and resource fork into two separate files. The data file will retain the original file name, and the resource file will have a '%' sign prefix. Note that the user must stitch the data fork and resource fork back to an AppleSingle file before submitting changes back to the Perforce server.
  • Added support for connecting to an IPv6 server address URI. IPv6 server addresses need to be encapsulated within square brackets (i.e. 'p4java://[fe80:0:0:0:0:0:c0a8:108]:1666'),
  • follow by a ':' and a port number. Auth tickets and trusted fingerprints also support the IPv6 server address format.
  • Added the ability to cancel a long running command in P4Java (i.e. syncing many files or a large file). The command can be cancelled by returning false in the IStreamingCallback's handleResult(...) method.
  • Added support for "spec -o" commands ('client -o', etc.). This feature can only be used with the raw "exec" methods (execMapCmd(), execStreamCmd(), etc.) of the IServer and IOptionsServer interfaces. The user must pass to those raw methods an 'inMap' as parameter with an 'useTags' map entry key and its value set to 'no'. The returning result will be the non-tagged output of the requested spec.
  • Added new methods IOptionsServer.get/setTicketsFilePath(...) and IOptionsServer.get/setTrustFilePath(...) for getting and setting the auth tickets file and the trust file paths.
  • Added new P4Java API methods to use the list data structure to store the result maps instead of array. Refactored all affected P4Java code to use these new methods: execMapCmdList, execInputStringMapCmdList and execQuietMapCmdList.
  • Added a new low-level IFilterCallback interface that allows developers to decide which key/value pairs should be skipped from going into the result maps. Currently, the IFilterCallback
  • interface is supported as a parameter in the following P4Java public API methods: IOptionsServer.execMapCmdList(É) and IOptionsServer.execInputStringMapCmdList(É).
  • Implemented the 'p4 property' command. Add, delete, or list property values in the Perforce server. The Perforce server does not directly use property values. It provides storage of property values for use by applications that wish to persistently store their configuration settings and other property data in the Perforce server.
  • Minor new functionality:
  • Added the ability to set socket performance preferences by passing a property to the ServerFactory when requesting an IOptionsServer object. The property key can be either the short form "sockPerfPrefs" or the long form "com.perforce.p4java.rpc.sockPerfPrefs". The property value
  • should be exactly three integers (i.e. "1, 2, 0") as a string, separated by commas. The default is set to the relative importance of short connection time, low latency, and high bandwidth.
  • Upgraded the JZlib compression library from version 1.0.2 to version 1.1.0. A list of changes can be view from the JZlib project website: http://www.jcraft.com/jzlib/ChangeLog
  • Updated P4Java to use JZlib's pure Java implementation of the CRC32 checksum. This avoids the basic Java CRC32's JNI overhead for certain uses of checksumming where many small pieces of data
  • are checksummed in succession.
  • Updated P4Java to use BufferedOutputStream to improve file writing performance during the 'sync' command.
  • Updated P4Java to use BufferedInputStream to improve RPC socket stream reading performance.
  • Added the 'quiet' option to CopyFilesOptions, IntegrateFilesOptions and MergeFilesOptions; corresponds to the "-q" flag in 'p4 copy', 'p4 integrate' and 'p4 merge' commands. If true, suppresses the normal informational file list messages from being sent.
  • Added the ability to set the 'quiet' mode "p4 -q " RPC protocol option to suppress all info-level output client messages. To enable protocol 'quite' mode set the "quietMode" or the long
  • form "com.perforce.p4java.quietMode" property to "true" (anything) when requesting an IOptionServer from the ServerFactory.
  • Added support for the 'resolveType' field of the 'p4 fstat -Or' command's output.
  • Added support for the 'baseParent' field of the 'p4 streams' command's tagged or/and filtered output.
  • Added the 'nameFilters' option to GetCountersOptions and GetKeysOptions; corresponding to the '-e[nameFilter] -e[nameFilter] -e[nameFilter] ...' flags in the 'p4 counters' and 'p4 keys' commands. This option handles multiple nameFilter flags as arguments to the aforementioned commands.
  • Added the 'force' option to ChangelistOptions; corresponds to the "-f" flag in 'p4 change' command. If true, it can force display of the 'Description' field in a restricted changelist using the IOptionsServer.getChangelist(int id, ChangelistOptions opts) method.
  • Added support for force delete of another user's pending changelist using the IOptionsServer.getChangelist(int id, ChangelistOptions opts) method with the 'force' option set to true in ChangelistOptions. This option corresponds to the "-f" flag in 'p4 change' command.
  • Added the 'stream' option to UnloadOptions and ReloadOptions; corresponds to the "-s stream" flag in 'p4 unload' and 'p4 reload' commands. If set, it unloads/reloads the specified task stream.
  • Also, added the 'locked' option to UnloadOptions; corresponds to the "-L" flag in the 'p4 unload' command. If true, it specifies that the client, label, or task stream should be unloaded even if
  • it is locked.
  • Added proper handling of P4Java's Perforce extended charsets if they are not loaded in the VM's bootstrap classpath. For example, the P4Java JAR file is inside a WAR deployed in a web app container like Jetty, Tomcat, etc.
  • Bugs fixed:
  • Fixed an issue with high-ascii client names (i.e. umlaut '‘') when running the 'where' command against a non-unicode server.
  • Added handling of the 'replaced' file action. This file action occurs when replacing a file with the same name, that was mapped from a different source.
  • Fixed an issue with text file (high-ascii chars in name or path) identified as a symlink during an add operation.
  • Deprecated ZeroConf support in P4Java. The server and proxy no longer support the Zeroconf server registration protocol. This takes effect on Perforce server version 2013.1 and above.
  • Fixed a problem with user auth tickets sharing a singleton storage when the same user is used in multiple RPC connections logging in and out frequently.
  • Fixed a possible memory leak by removing the File.deleteOnExit() call in P4Java. Java accumulates the file path information in memory every time the File.deleteOnExit() call is made. If the the Java program stays alive for a long period of time, the memory usage will grow.
  • Fixed an issue with the AuthTicketsHelper throwing an exception (FileNotFoundException) when trying to retrieve auth tickets from an auth tickets file that does not exist.
  • Fixed a problem with P4Java not properly handling (save/change) passwords with high-ascii/unicode chars (i.e. umlaut '‘').
  • Fixed an issue with P4Java's Perforce file type detection (infer file type by content) mistakenly detected 'utf16' (unicode) files as binary.
  • Fixed an issue with P4Java not properly converting the 'diff2' command header output to the client's charset.

New in P4Java 2012.3 (Aug 2, 2013)

  • Major new functionality:
  • Added support for symbolic links with JDK 7 running on UNIX and newer versions of Windows. Hard links are available as of Windows 2000, and symbolic links as of Windows Vista. Therefore, for symbolic link support the Windows version needs to be Windows Vista or above.
  • Added support for progress indicators (p4 -I ). This feature is supported by Perforce server 2012.2 or higher. To enable 'p4 -I' set the "com.perforce.p4java.enableProgress" or "enableProgress" property to "true" (or anything) when requesting an IOptionServer from the ServerFactory class (as the Properties 'props' parameter pass to the getOptionsServer() method). This feature makes sense to be used with the "raw" IServer.execStreamingMapCommand() method. This streaming method takes a callback handler and continuously report progress during the execution of a command. Note that currently only some commands return progress indicators.
  • Added support for unload and reload clients and labels. Implemented the 'p4 unload' and 'p4 reload' commands. Added the '-U' option for 'p4 clients' and 'p4 labels'. By default, users can only unload and reload their own clients or labels. The '-f' flag requires 'admin' access, which is granted by 'p4 protect'.
  • Added the IOptionsServer.getStreamingExportRecords(...) method. This method returns each exported journal or checkpoint record as it comes in from the Perforce server using the IStreamingCallback handleResult method.
  • Added support for the 'p4 populate' command as the populateFiles(...) method on IOptionsServer. This method branches a set of files (the 'source') into another depot location (the 'target') in a single step. The new files are created immediately, without requiring a 'p4 submit' or a client workspace.
  • Added new IClient.sync(...) and IChangelist.submit(...) methods with IStreamingCallback. When progress indicators are turned on (set the "com.perforce.p4java.enableProgress" or "enableProgress" property to "true" when requesting an IOptionServer from the ServerFactory), the results are sent to the user via IStreamingCallback.handleResult(...), as each comes in from the server.
  • Added support for streaming back incremental progress details of syncing and submitting files. The file data chunks info (bytes written so far...) will be sent back to the user via IStreamingCallback.handleResult(...). This feature requires the progress indicators flag (p4 -I) to be on, set the "enableProgress" or "com.perforce.p4java.enableProgress" property to "true" when you request an IOptionServer from the ServerFactory.
  • Added in-memory storage for auth tickets and fingerprints. By default, P4Java uses files to store auth tickets and SSL connection fingerprints. To turn on in-memory storage of auth tickets and fingerprints set the "useAuthMemoryStore" or the long form "com.perforce.p4java.useAuthMemoryStore" property to "true" (or anything) when requesting an IOptionServer from the ServerFactory.
  • Minor new functionality in 2012.3:
  • Automatically set the user's auth ticket (if available) when calling the Server.setUserName(String userName) method. Unset the user's auth ticket after logging out. This is useful when you are using (switching between) multiple Perforce users within the same instance of P4Java.
  • Added the 'dontAnnotateFiles' option to the GetFileContentsOptions class. If true, don't append revision specifiers (# and @) to the filespecs (Parameters.processParameters(...)). By default the filespecs passed to IOptionsServer.getFileContents(...) would get revisions appended to them during parameter processing. Note that this is not a standard option for the 'p4 print' command.