test_class.declarator: home
test_class.modifier: private
test_class.original_string: private Folder home;
test_class.type: Folder
test_class.var_name: home
test_class.file: dataprep-api/src/test/java/org/talend/dataprep/api/service/FolderAPITest.java
test_class.identifier: FolderAPITest
test_class.superclass: extends ApiServiceTestBase
test_case.body: @Test
      public void should_remove_empty_folder() throws IOException {
          //given
          createFolder("beer", home.getId());
          final Folder beer = getFolder(home.getId(), "beer");
  
          //when
          final Response response = removeFolder(beer.getId());
  
          //then
          assertThat(response.getStatusCode(), is(204));
          final List<Folder> folders = getFolderChildren(home.getId());
          assertThat(folders, is(empty()));
      }
test_case.class_method_signature: FolderAPITest.should_remove_empty_folder()
test_case.full_signature: @Test public void should_remove_empty_folder()
test_case.identifier: should_remove_empty_folder
test_case.invocations: createFolder getId getFolder getId removeFolder getId assertThat getStatusCode is getFolderChildren getId assertThat is empty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_remove_empty_folder()
focal_class.file: dataprep-api/src/main/java/org/talend/dataprep/api/service/FolderAPI.java
focal_class.identifier: FolderAPI
focal_class.class_method_signature: FolderAPI.listFolders(@RequestParam(required = false) String parentId)
focal_class.full_signature: @RequestMapping(value = "/api/folders", method = GET) @ApiOperation(value = "List folders. Optional filter on parent ID may be supplied.", produces = APPLICATION_JSON_VALUE) @Timed public ResponseEntity<StreamingResponseBody> listFolders(@RequestParam(required = false) String parentId)
focal_class.identifier: listFolders
focal_class.modifiers: @RequestMapping(value = "/api/folders", method = GET) @ApiOperation(value = "List folders. Optional filter on parent ID may be supplied.", produces = APPLICATION_JSON_VALUE) @Timed public
focal_class.parameters: (@RequestParam(required = false) String parentId)
focal_class.return: ResponseEntity<StreamingResponseBody>
focal_class.signature: ResponseEntity<StreamingResponseBody> listFolders(@RequestParam(required = false) String parentId)
focal_class.class_method_signature: FolderAPI.getTree()
focal_class.full_signature: @RequestMapping(value = "/api/folders/tree", method = GET) @ApiOperation(value = "List all folders", produces = APPLICATION_JSON_VALUE) @Timed public StreamingResponseBody getTree()
focal_class.identifier: getTree
focal_class.modifiers: @RequestMapping(value = "/api/folders/tree", method = GET) @ApiOperation(value = "List all folders", produces = APPLICATION_JSON_VALUE) @Timed public
focal_class.parameters: ()
focal_class.return: StreamingResponseBody
focal_class.signature: StreamingResponseBody getTree()
focal_class.class_method_signature: FolderAPI.getFolderAndHierarchyById(@PathVariable(value = "id") final String id)
focal_class.full_signature: @RequestMapping(value = "/api/folders/{id}", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get folder by id", produces = APPLICATION_JSON_VALUE, notes = "Get a folder by id") @Timed public ResponseEntity<StreamingResponseBody> getFolderAndHierarchyById(@PathVariable(value = "id") final String id)
focal_class.identifier: getFolderAndHierarchyById
focal_class.modifiers: @RequestMapping(value = "/api/folders/{id}", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get folder by id", produces = APPLICATION_JSON_VALUE, notes = "Get a folder by id") @Timed public
focal_class.parameters: (@PathVariable(value = "id") final String id)
focal_class.return: ResponseEntity<StreamingResponseBody>
focal_class.signature: ResponseEntity<StreamingResponseBody> getFolderAndHierarchyById(@PathVariable(value = "id") final String id)
focal_class.class_method_signature: FolderAPI.addFolder(@RequestParam(required = false) final String parentId,
              @RequestParam final String path)
focal_class.full_signature: @RequestMapping(value = "/api/folders", method = PUT) @ApiOperation(value = "Add a folder.", produces = APPLICATION_JSON_VALUE) @Timed public StreamingResponseBody addFolder(@RequestParam(required = false) final String parentId,
              @RequestParam final String path)
focal_class.identifier: addFolder
focal_class.modifiers: @RequestMapping(value = "/api/folders", method = PUT) @ApiOperation(value = "Add a folder.", produces = APPLICATION_JSON_VALUE) @Timed public
focal_class.parameters: (@RequestParam(required = false) final String parentId,
              @RequestParam final String path)
focal_class.return: StreamingResponseBody
focal_class.signature: StreamingResponseBody addFolder(@RequestParam(required = false) final String parentId,
              @RequestParam final String path)
focal_class.class_method_signature: FolderAPI.removeFolder(@PathVariable final String id, final OutputStream output)
focal_class.full_signature: @RequestMapping(value = "/api/folders/{id}", method = DELETE) @ApiOperation(value = "Remove a Folder") @Timed public ResponseEntity<String> removeFolder(@PathVariable final String id, final OutputStream output)
focal_class.identifier: removeFolder
focal_class.modifiers: @RequestMapping(value = "/api/folders/{id}", method = DELETE) @ApiOperation(value = "Remove a Folder") @Timed public
focal_class.parameters: (@PathVariable final String id, final OutputStream output)
focal_class.return: ResponseEntity<String>
focal_class.signature: ResponseEntity<String> removeFolder(@PathVariable final String id, final OutputStream output)
focal_class.class_method_signature: FolderAPI.renameFolder(@PathVariable final String id, @RequestBody final String newName)
focal_class.full_signature: @RequestMapping(value = "/api/folders/{id}/name", method = PUT) @ApiOperation(value = "Rename a Folder") @Timed public void renameFolder(@PathVariable final String id, @RequestBody final String newName)
focal_class.identifier: renameFolder
focal_class.modifiers: @RequestMapping(value = "/api/folders/{id}/name", method = PUT) @ApiOperation(value = "Rename a Folder") @Timed public
focal_class.parameters: (@PathVariable final String id, @RequestBody final String newName)
focal_class.return: void
focal_class.signature: void renameFolder(@PathVariable final String id, @RequestBody final String newName)
focal_class.class_method_signature: FolderAPI.search(@RequestParam(required = false) final String name,
              @RequestParam(required = false) final Boolean strict, @RequestParam(required = false) final String path)
focal_class.full_signature: @RequestMapping(value = "/api/folders/search", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Search Folders with parameter as part of the name", produces = APPLICATION_JSON_VALUE) @Timed public ResponseEntity<StreamingResponseBody> search(@RequestParam(required = false) final String name,
              @RequestParam(required = false) final Boolean strict, @RequestParam(required = false) final String path)
focal_class.identifier: search
focal_class.modifiers: @RequestMapping(value = "/api/folders/search", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Search Folders with parameter as part of the name", produces = APPLICATION_JSON_VALUE) @Timed public
focal_class.parameters: (@RequestParam(required = false) final String name,
              @RequestParam(required = false) final Boolean strict, @RequestParam(required = false) final String path)
focal_class.return: ResponseEntity<StreamingResponseBody>
focal_class.signature: ResponseEntity<StreamingResponseBody> search(@RequestParam(required = false) final String name,
              @RequestParam(required = false) final Boolean strict, @RequestParam(required = false) final String path)
focal_class.class_method_signature: FolderAPI.listPreparationsByFolder(
              @PathVariable @ApiParam(name = "id", value = "The destination to search preparations from.") final String id, //
              @ApiParam(value = "Sort key (by name or date), defaults to 'date'.") @RequestParam(defaultValue = "creationDate") final Sort sort, //
              @ApiParam(value = "Order for sort key (desc or asc), defaults to 'desc'.") @RequestParam(defaultValue = "desc") final Order order)
focal_class.full_signature: @RequestMapping(value = "/api/folders/{id}/preparations", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get all preparations for a given id.", notes = "Returns the list of preparations for the given id the current user is allowed to see.") @Timed public PreparationsByFolder listPreparationsByFolder(
              @PathVariable @ApiParam(name = "id", value = "The destination to search preparations from.") final String id, //
              @ApiParam(value = "Sort key (by name or date), defaults to 'date'.") @RequestParam(defaultValue = "creationDate") final Sort sort, //
              @ApiParam(value = "Order for sort key (desc or asc), defaults to 'desc'.") @RequestParam(defaultValue = "desc") final Order order)
focal_class.identifier: listPreparationsByFolder
focal_class.modifiers: @RequestMapping(value = "/api/folders/{id}/preparations", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get all preparations for a given id.", notes = "Returns the list of preparations for the given id the current user is allowed to see.") @Timed public
focal_class.parameters: (
              @PathVariable @ApiParam(name = "id", value = "The destination to search preparations from.") final String id, //
              @ApiParam(value = "Sort key (by name or date), defaults to 'date'.") @RequestParam(defaultValue = "creationDate") final Sort sort, //
              @ApiParam(value = "Order for sort key (desc or asc), defaults to 'desc'.") @RequestParam(defaultValue = "desc") final Order order)
focal_class.return: PreparationsByFolder
focal_class.signature: PreparationsByFolder listPreparationsByFolder(
              @PathVariable @ApiParam(name = "id", value = "The destination to search preparations from.") final String id, //
              @ApiParam(value = "Sort key (by name or date), defaults to 'date'.") @RequestParam(defaultValue = "creationDate") final Sort sort, //
              @ApiParam(value = "Order for sort key (desc or asc), defaults to 'desc'.") @RequestParam(defaultValue = "desc") final Order order)
focal_class.superclass: extends APIService
focal_method.body: @RequestMapping(value = "/api/folders/{id}", method = DELETE)
      @ApiOperation(value = "Remove a Folder")
      @Timed
      public ResponseEntity<String> removeFolder(@PathVariable final String id, final OutputStream output) {
          try {
              return getCommand(RemoveFolder.class, id).execute();
          } catch (Exception e) {
              throw new TDPException(APIErrorCodes.UNABLE_TO_DELETE_FOLDER, e);
          }
      }
focal_method.class_method_signature: FolderAPI.removeFolder(@PathVariable final String id, final OutputStream output)
focal_method.full_signature: @RequestMapping(value = "/api/folders/{id}", method = DELETE) @ApiOperation(value = "Remove a Folder") @Timed public ResponseEntity<String> removeFolder(@PathVariable final String id, final OutputStream output)
focal_method.identifier: removeFolder
focal_method.invocations: execute getCommand
focal_method.modifiers: @RequestMapping(value = "/api/folders/{id}", method = DELETE) @ApiOperation(value = "Remove a Folder") @Timed public
focal_method.parameters: (@PathVariable final String id, final OutputStream output)
focal_method.return: ResponseEntity<String>
focal_method.signature: ResponseEntity<String> removeFolder(@PathVariable final String id, final OutputStream output)