Interface IMoveDelegator
-
- All Known Subinterfaces:
IOptionsServer
,IServer
,IStreamingServer
- All Known Implementing Classes:
MoveDelegator
,NtsServerImpl
,OneShotServerImpl
,RpcServer
,Server
public interface IMoveDelegator
Interface to handle the Move command.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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(IFileSpec fromFile, IFileSpec toFile, MoveFileOptions opts)
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile).
-
-
-
Method Detail
-
moveFile
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
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile). A file can be moved many times before it is submitted; moving it back to its original location will reopen it for edit. The full semantics of this operation (which can be confusing) are found in the main 'p4 help' documentation.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.
- Parameters:
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.- Returns:
- list of IFileSpec objects representing the results of this move
- Throws:
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 caller
-
moveFile
java.util.List<IFileSpec> moveFile(@Nonnull IFileSpec fromFile, @Nonnull IFileSpec toFile, @Nullable MoveFileOptions opts) throws P4JavaException
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile). A file can be moved many times before it is submitted; moving it back to its original location will reopen it for edit. The full semantics of this operation (which can be confusing) are found in the main 'p4 help' documentation.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.
- Parameters:
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.- Returns:
- list of IFileSpec objects representing the results of this move.
- Throws:
P4JavaException
- if any error occurs in the processing of this method.
-
-