protected void doCopy(RequestContext requestContext, String resourcePath, String newPath) throws RegistryException { requestContext.getRegistry().copy(resourcePath, newPath); } }
public void copy(String s, String s1) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException { // A read only session must not be allowed to copy a node RegistryJCRItemOperationUtil.validateReadOnlyItemOpr(registrySession); try { if (userRegistry != null) { userRegistry.copy(s, s1); } } catch (Exception e) { e.printStackTrace(); } }
public void copySavedReport(String name, String newName) throws RegistryException{ boolean reportExist = isReportExist(newName); if (!reportExist) { getConfigSystemRegistry().copy(REPORTING_CONFIG_PATH + RegistryConstants.PATH_SEPARATOR + name, REPORTING_CONFIG_PATH + RegistryConstants.PATH_SEPARATOR + newName); } else { String msg = "Report name already exist in the registry"; throw new RegistryException(msg); } }
registry.copy(path, newPath); Resource r = registry.get(newPath); registry.addAssociation(newPath, path, "original");
/** * Copies current Documentation into another version of the same WebApp. * * @param toVersion Version to which Documentation should be copied. * @param apiId id of the APIIdentifier * @throws org.wso2.carbon.apimgt.api.APIManagementException * if failed to copy docs */ public void copyAllDocumentation(APIIdentifier apiId, String toVersion) throws AppManagementException { String oldVersion = AppManagerUtil.getAPIDocPath(apiId); String newVersion = AppMConstants.API_ROOT_LOCATION + RegistryConstants.PATH_SEPARATOR + apiId.getProviderName() + RegistryConstants.PATH_SEPARATOR + apiId.getApiName() + RegistryConstants.PATH_SEPARATOR + toVersion + RegistryConstants.PATH_SEPARATOR + AppMConstants.DOC_DIR; try { Resource resource = registry.get(oldVersion); if (resource instanceof org.wso2.carbon.registry.core.Collection) { String[] docsPaths = ((org.wso2.carbon.registry.core.Collection) resource).getChildren(); for (String docPath : docsPaths) { registry.copy(docPath, newVersion); } } } catch (RegistryException e) { handleException("Failed to copy docs to new version : " + newVersion, e); } }
registry.copy(sourceFilePath, targetFilePath);
/** * See CMIS 1.0 section 2.2.4.2 createDocumentFromSource * * @throws CmisStorageException */ public RegistryObject addNodeFromSource(RegistryDocument source, Properties properties) { try { String filename = source.getNodeName(); String destPath = getRepository().copy(source.getNode().getPath(), getNode().getPath() + "/" + filename); RegistryObject gregObject = create(getRepository().get(destPath)); // overlay new properties if (properties != null && properties.getProperties() != null) { updateProperties(gregObject.getNode(), gregObject.getTypeId(), properties); } //session.save(); return gregObject; } catch (RegistryException e) { String msg = "Failed to add the node " + source.getId(); log.error(msg, e); throw new CmisStorageException(msg, e); } }
repository.copy(node.getPath(), destPath);