1 Reply Latest reply: Apr 22, 2008 9:47 AM by 508001 RSS

    Creating folder hierarchy in one WS call

    560578
      Hi all!
      is there a way to create a folder hierarchy in one WS call when folders are all in one level hierarchy? i.e. /existingPath/newDir1/newDir2/newDir3

      fileManager.createFolders( existingPathItem.getId(), PASSING ALL NEW FOLDER NAMES here )


      ..or is the only way is to call createFolder multiple times ?

      Thanks
        • 1. Re: Creating folder hierarchy in one WS call
          508001
          I do something like.

          Create an Array List
          Populate the Array list witht eh folder names

          ArrayList<NamedValueSet> foldersList = new ArrayList<NamedValueSet>();

          foldersList.add(new NamedValueSet(new NamedValue[]{
          new NamedValue(Attributes.NAME, foldersRow.getFolderName()),
          new NamedValue(Attributes.DESCRIPTION,foldersRow.getStageDesc())
          }));

          NamedValueSet[] foldersSet = foldersList.toArray(new NamedValueSet[1]);

          Item[] stageFolder = fileM.createFolders(new long[] {paperFolder.getId()},
          foldersSet,
          null );

          Hop this helps.