RenameResource

Rename a resource.

Note: This procedure is different from the web services operation of the same name, which is in the resource tree under /services/webservices/system/admin/resource/operations/.

Location

/lib/resource/

Inputs

path: A source path of the resource to rename.

type: The type of the source resource to rename.

newName: The new name of the resource.

Outputs

N/A

Exceptions

DuplicateNameException: If a resource already exists with the new name and that is the same type as the resource being renamed.

IllegalArgumentException: If the path is malformed or the type is illegal.

IllegalStateException: If the resource is not allowed to be renamed. Resources within a physical data source, user home folders, the /shared folder, /services/databases, and /services/webservices cannot be renamed.

NotFoundException: If the resource does not exist.

SecurityException: If the user does not have READ access on all items in the path other than the last one.

SecurityException: If the user does not have WRITE access to the last item in path.