跳过导航链接
org.noear.solon.core.handle

类 UploadedFile

    • 构造器详细资料

      • UploadedFile

        public UploadedFile()
        上传文件
      • UploadedFile

        public UploadedFile(String contentType,
                            InputStream content,
                            String name)
        上传文件
        参数:
        contentType - 内容类型
        content - 内容流
        name - 文件名
      • UploadedFile

        public UploadedFile(String contentType,
                            long contentSize,
                            InputStream content,
                            String name,
                            String extension)
        基于上传输入的构建函数
        参数:
        contentType - 内容类型
        contentSize - 内容大小
        content - 内容流
        name - 文件名
        extension - 文件后缀名
      • UploadedFile

        public UploadedFile(Closeable deleteAction,
                            String contentType,
                            long contentSize,
                            InputStream content,
                            String name,
                            String extension)
        上传文件
        参数:
        contentType - 内容类型
        contentSize - 内容大小
        content - 内容流
        name - 文件名
        extension - 文件后缀名
    • 方法详细资料

      • getExtension

        public String getExtension()
        扩展名(例:jpg)
      • getContent

        public InputStream getContent()
        内容流
      • getContentAsBytes

        public byte[] getContentAsBytes()
                                 throws IOException
        内容字节形式
        抛出:
        IOException
        从以下版本开始:
        2.8
      • getContentSize

        public long getContentSize()
        内容大小
      • transferTo

        public void transferTo(File file)
                        throws IOException
        将内容流迁移到目标文件
        参数:
        file - 目标文件
        抛出:
        IOException

Copyright © 2024. All rights reserved.