class KogitoResourceContentService {

    public void getFilteredItems(final String pattern,
                                 final RemoteCallback<List<String>> callback,
                                 final ErrorCallback<Object> errorCallback) {
        resourceContentService.list(pattern).then(fileList -> {
            callback.callback(Arrays.asList(fileList));
            return promises.resolve();
        })
                .catch_(error -> {
                    errorCallback.error("Error " + error, new Throwable("Failed to retrieve files with pattern " + pattern));
                    return null;
                });
    }

    private  KogitoResourceContentService();
    @Inject public  KogitoResourceContentService(final ResourceContentService resourceContentService,
                                        final Promises promises);

}