Class Download

java.lang.Object
cool.scx.web.vo.Download
All Implemented Interfaces:
cool.scx.function.Function1Void<cool.scx.http.routing.RoutingContext, Exception>, BaseVo

public final class Download extends Object
文件下载 vo
Version:
0.0.1
Author:
scx567888
  • Field Details

    • inputStream

      protected final InputStream inputStream
    • path

      protected final Path path
    • bytes

      protected final byte[] bytes
    • type

      protected final cool.scx.web.vo.BaseWriter.Type type
    • contentType

      protected final cool.scx.http.media_type.MediaType contentType
    • contentDisposition

      protected final String contentDisposition
  • Method Details

    • of

      public static Download of(InputStream inputStream, String downloadName)
    • of

      public static Download of(byte[] bytes, String downloadName)
    • of

      public static Download of(Path path, String downloadName)
    • of

      public static Download of(Path path)
    • fillContentType

      public static cool.scx.http.ScxHttpServerResponse fillContentType(cool.scx.http.ScxHttpServerResponse response, cool.scx.http.media_type.MediaType contentType)
    • apply

      public final void apply(cool.scx.http.routing.RoutingContext context)
      Specified by:
      apply in interface cool.scx.function.Function1Void<cool.scx.http.routing.RoutingContext, Exception>