org.springframework.http.codec.multipart

Interface FilePart

  • All Superinterfaces:
    Part


    public interface FilePart
    extends Part
    Specialization of Part that represents an uploaded file received in a multipart request.
    Since:
    5.0
    Author:
    Rossen Stoyanchev, Juergen Hoeller
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method and Description
      java.lang.String filename()
      Return the original filename in the client's filesystem.
      default reactor.core.publisher.Mono<java.lang.Void> transferTo(java.io.File dest)
      Convenience method to copy the content of the file in this part to the given destination file.
      reactor.core.publisher.Mono<java.lang.Void> transferTo(java.nio.file.Path dest)
      Convenience method to copy the content of the file in this part to the given destination file.
    • Method Detail

      • filename

        java.lang.String filename()
        Return the original filename in the client's filesystem.
      • transferTo

        default reactor.core.publisher.Mono<java.lang.Void> transferTo(java.io.File dest)
        Convenience method to copy the content of the file in this part to the given destination file. If the destination file already exists, it will be truncated first.

        The default implementation delegates to transferTo(Path).

        Parameters:
        dest - the target file
        Returns:
        completion Mono with the result of the file transfer, possibly IllegalStateException if the part isn't a file
        See Also:
        transferTo(Path)
      • transferTo

        reactor.core.publisher.Mono<java.lang.Void> transferTo(java.nio.file.Path dest)
        Convenience method to copy the content of the file in this part to the given destination file. If the destination file already exists, it will be truncated first.
        Parameters:
        dest - the target file
        Returns:
        completion Mono with the result of the file transfer, possibly IllegalStateException if the part isn't a file
        Since:
        5.1
        See Also:
        transferTo(File)