Interface UploadHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UploadHandler
File upload handler. Handles image and file uploads in the editor.

Usage examples:

 // Upload to local filesystem
 editor.setUploadHandler((context, stream) -> {
     String filename = context.getFileName();
     Path targetPath = uploadDir.resolve(filename);
     Files.copy(stream, targetPath);
     return CompletableFuture.completedFuture(
         new UploadResult("/uploads/" + filename)
     );
 });

 // Upload to cloud storage
 editor.setUploadHandler((context, stream) -> {
     return cloudStorage.uploadAsync(stream, context.getFileName())
         .thenApply(url -> new UploadResult(url));
 });