public interface IMoveDelegator
Modifier and Type | Method and Description |
---|---|
java.util.List<IFileSpec> |
moveFile(IFileSpec fromFile,
IFileSpec toFile,
MoveFileOptions opts)
Move a file already opened for edit or add (the fromFile) to the
destination file (the toFile).
|
java.util.List<IFileSpec> |
moveFile(int changelistId,
boolean listOnly,
boolean noClientMove,
java.lang.String fileType,
IFileSpec fromFile,
IFileSpec toFile)
Move a file already opened for edit or add (the fromFile) to the
destination file (the toFile).
|
java.util.List<IFileSpec> moveFile(int changelistId, boolean listOnly, boolean noClientMove, java.lang.String fileType, @Nonnull IFileSpec fromFile, @Nonnull IFileSpec toFile) throws ConnectionException, RequestException, AccessException
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message. Similarly, not all underlying IServer implementations will work with this either, and will also result in a suitable RequestException.
Note also that the move command is special in that almost alone among Perforce file-based commands, it does not allow full filespecs with version specifiers; these are currently quietly stripped off in the move command implementation here, which may lead to unexpected behaviour if you pass in specific versions expecting them to be honoured.
changelistId
- if not IChangelist.UNKNOWN, the files are opened in the
numbered pending changelist instead of the 'default'
changelist.listOnly
- if true, don't actually perform the move, just return what
would happen if the move was performednoClientMove
- if true, bypasses the client file rename. This option can be
used to tell the server that the user has already renamed a
file on the client. The use of this option can confuse the
server if you are wrong about the client's contents. Only
works for 2009.2 and later servers; earlier servers will
produce a RequestException if you set this true.fileType
- if not null, the file is reopened as that filetype.fromFile
- the original file; must be already open for edit.toFile
- the target file.ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerjava.util.List<IFileSpec> moveFile(@Nonnull IFileSpec fromFile, @Nonnull IFileSpec toFile, @Nullable MoveFileOptions opts) throws P4JavaException
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message.
Note also that the move command is special in that almost alone among Perforce file-based commands, it does not allow full filespecs with version specifiers; these are currently quietly stripped off in the move command implementation here, which may lead to unexpected behaviour if you pass in specific versions expecting them to be honoured.
fromFile
- the original file; must be already open for edit.toFile
- the target file.opts
- MoveFileOptions object describing optional parameters; if
null, no options are set.P4JavaException
- if any error occurs in the processing of this method.