How to pass a List to a constructor of a new object using java lambda expression?

I have a problem where I want to convert a list of POJOs into DTOs and pass them into a wrapper object which is then returned. Consider this working piece of code: List<Device> devices = dbService.getDevices(…); List<DeviceDTO> devicesDTO = new ArrayList<DeviceDTO>(); for (Device d : devices) { devicesDTO.add(convertToDTO(d)); } WrapperDTO wrapper = new WrapperDTO(devicesDTO); I…

Details

How to reduce the size of an image when uploading it to a project

I need help to reduce the size of an image. I know that it is necessary to resize() but I do not understand where to insert it. Controller: $target_file_name = public_path().’/upload/’.Str::random(10); $type = $_FILES[“image2”][“type”]; $type = stristr($type, ‘/’); $type = substr($type, 1); $response = array(); move_uploaded_file($_FILES[“image2”][“tmp_name”], $target_file_name.’.’.$type); $dopysk->ydostak =basename($request=$target_file_name.’.’.$type );

Details