Class Download

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

public final class Download extends Object
文件下载 vo
Version:
1.0.10
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.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.MediaType contentType)
    • accept

      public final void accept(cool.scx.http.routing.RoutingContext context)
      Specified by:
      accept in interface cool.scx.common.functional.ScxConsumer<cool.scx.http.routing.RoutingContext,Exception>