Document toolboxDocument toolbox

Java API for Adding Folder

Applies to: Kyvos Enterprise  Kyvos Cloud (SaaS on AWS) Kyvos AWS Marketplace

Kyvos Azure Marketplace   Kyvos GCP Marketplace Kyvos Single Node Installation (Kyvos SNI)


Overview

Create a new folder by specifying the folder name and type.

  1. Add the folder object to the repository.

Example

  1. Create a new folder by specifying the folder name and type.

    /** * method to create folder in Repository Manager. * @param folderName: Name of the folder to be created. * @param type: Type of folder to be created, enum type RepositoryManager.folderType. * @param userInfo: Object of type UserInfo containing information about logged in user. * @return folderObj: Object of type Folder. */ public Folder createFolder(String folderName, folderType type, UserInfo userInfo);
  2. Add the folder object to the repository

    /** * method to add folder in Repository Manager. * @param folderObj: Object of type Folder. * @param userInfo: Object of type UserInfo containing information about logged in user. */ public void addFolder(Folder folderObj, UserInfo userInfo);

Sample code

/*Method to create folder in Semantic model Section*/  public static void addFolderinCube(RepositoryManager repManager, UserInfo userInfo) { try { Folder cubefolder = repManager.createFolder("FolderName", folderType.CUBE, userInfo); repManager.addFolder(cubefolder, userInfo); } catch (FolderManagerException e) { e.printStackTrace(); } } /*Method to create folder in File Section*/ public static void addFolderinFiles(RepositoryManager repManager, UserInfo userInfo) { try { Folder rffolder = repManager.createFolder("FolderName", folderType.REGISTERED_FILE, userInfo); repManager.addFolder(rffolder, userInfo); } catch (FolderManagerException e) { e.printStackTrace(); } } /*Method to create folder in DRD Section*/ public static void addFolderinDRD(RepositoryManager repManager, UserInfo userInfo) { try { Folder drdfolder = repManager.createFolder("FolderName", folderType.DRD, userInfo); repManager.addFolder(drdfolder, userInfo); } catch (FolderManagerException e) { e.printStackTrace(); }        }

 



Copyright Kyvos, Inc. All rights reserved.