public final class RenameUtility extends Object
IResource.| Constructor and Description |
|---|
RenameUtility(IResource source,
String newName)
checks the validity of the given arguments.
|
| Modifier and Type | Method and Description |
|---|---|
protected Result |
rename()
modifies the displayname property of the
IResource and updates
its name-attribute. |
Result |
rename(boolean preserveExtension) |
public RenameUtility(IResource source, String newName) throws WcmException
NullPointerException is thrown,
if one of them is null, an IllegalArgumentException is thrown,
if the newName argument consists of only space-characters: "".equals(newName.trim()) source - the resource to be renamednewName - the new name for the resourceWcmException - if the resource does not allow the setting of propertiesprotected Result rename()
IResource and updates
its name-attribute. Since the newName-attribute of this class might contain
invalid characters or might be non unique within the parent collection of the
folder, this method uses the IDResolver to calculate a valid and
unique ID for this IResource.
If the IResource does nto support the SupportOption.SET_PROPERTIES,
no modification will be done.
Because two operations are carried out on the IResource, the method needs to
lock it. If the IResource is locked by another user, the method will abort.
If it is already locked by the current user, no further lock is acquired. If it is versioned,
it will be checked out (if it is not already so).
After the modifications have been done, the resource will be checked in again, if it is versioned
and was checked out by this method. The lock will be released already by the IResource's
method rename(String name), regardless if this method locked it or if it was locked
before.IResource. Its status-attribute will tell, if
the modifications have been successful or not.public Result rename(boolean preserveExtension)
preserveExtension - no descriptionResult data object that keeps resulting information about rename operation| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2017 SAP AG Complete Copyright Notice