simplified deprecated methods

This commit is contained in:
Michele Artini 2024-02-27 15:03:02 +01:00
parent 4c3a1af2d2
commit 07cd4dda85
1 changed files with 6 additions and 41 deletions

View File

@ -431,13 +431,7 @@ public class CommunityApiController extends AbstractExporterController {
})
public List<CommunityContentprovider> getCommunityContentproviders(@PathVariable final String id, @RequestParam(required = false) final Boolean deposit)
throws CommunityException {
try {
return deposit == null ? communityService.getCommunityDatasources(id) : communityService.getCommunityDatasourcesWithDeposit(id, deposit);
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
throw new CommunityException(e);
}
return getCommunityDatasources(id, deposit);
}
@Deprecated
@ -454,14 +448,7 @@ public class CommunityApiController extends AbstractExporterController {
@PathVariable final String id,
@RequestBody final CommunityContentprovider contentprovider) throws CommunityException {
try {
communityService.addCommunityDatasources(id, contentprovider);
return contentprovider;
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
throw new CommunityException(e);
}
return addCommunityDatasource(id, contentprovider);
}
@Deprecated
@ -474,16 +461,8 @@ public class CommunityApiController extends AbstractExporterController {
@ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error")
})
public void removeCommunityContentprovider(
@PathVariable final String id,
@RequestParam final String contentproviderId) throws CommunityException {
try {
communityService.removeCommunityDatasources(id, contentproviderId);
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
throw new CommunityException(e);
}
public void removeCommunityContentprovider(@PathVariable final String id, @RequestParam final String contentproviderId) throws CommunityException {
removeCommunityDatasource(id, contentproviderId);
}
@Deprecated
@ -499,15 +478,7 @@ public class CommunityApiController extends AbstractExporterController {
public CommunityContentprovider[] addCommunityContentProvidersList(
@PathVariable final String id,
@RequestBody final CommunityContentprovider[] contentprovidersList) throws CommunityException {
try {
communityService.addCommunityDatasources(id, contentprovidersList);
return contentprovidersList;
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
throw new CommunityException(e);
}
return addCommunityDatasourcesList(id, contentprovidersList);
}
@Deprecated
@ -523,13 +494,7 @@ public class CommunityApiController extends AbstractExporterController {
public void deleteCommunityContentProvidersList(
@PathVariable final String id,
@RequestBody final String[] contentProviderIdList) throws CommunityException {
try {
communityService.removeCommunityDatasources(id, contentProviderIdList);
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
throw new CommunityException(e);
}
deleteCommunityDatasourcesList(id, contentProviderIdList);
}
// ORGANIZATIONS