Chce do fileDtos dodać pewne dane z files streamami . niestety nie działa mi (pokazany przykład na dole).. Może pomoże ktoś w tej kwestii z góry dzięki
FileDto
public class FileDto {
private String name;
private byte[] content;
private String extension;
public String getPath() {
return path;
}
private String path;
public FileDto(String name, byte[] content, String extension) {
super();
this.name = name;
this.content = content;
this.extension = extension;
}
public FileDto(String name) {
super();
this.name = name;
}
public void setPath(String path) {
this.path = path;
}
public FileDto() {
super();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
public String getExtension() {
return extension;
}
public void setExtension(String extension) {
this.extension = extension;
}
}
List<File> files = ArrayList<>();
files.add(new Files(paths));
List<FileDto> fileDto = new ArrayLIst<>();
/*tu jest błąd, Jest to przykład o co mi chodzi w ogóle */
fileDtos.stream().map(fileDto->new FileDto(findFiles().stream().map(f->f.getName())));