public interface FileWrapper
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getContentType()
获取文件的 MIME 类型
|
InputStream |
getInputStream()
获取文件的 InputStream
|
default void |
getInputStreamMaskReset(IOExceptionConsumer<InputStream> consumer)
获取文件的 InputStream 并读取,会自动标记和重置流的位置
|
default <R> R |
getInputStreamMaskResetReturn(IOExceptionFunction<InputStream,R> function)
获取文件的 InputStream 并读取,会自动标记和重置流的位置
|
String |
getName()
获取文件名称
|
Long |
getSize()
获取文件大小
|
void |
setContentType(String contentType)
设置文件的 MIME 类型
|
void |
setName(String name)
设置文件名称
|
void |
setSize(Long size)
设置文件大小
|
default boolean |
supportTransfer()
是否支持移动文件
|
default void |
transferTo(File dest)
移动文件
|
String getName()
void setName(String name)
String getContentType()
void setContentType(String contentType)
InputStream getInputStream() throws IOException
IOExceptiondefault void getInputStreamMaskReset(IOExceptionConsumer<InputStream> consumer) throws IOException
IOExceptiondefault <R> R getInputStreamMaskResetReturn(IOExceptionFunction<InputStream,R> function) throws IOException
IOExceptionLong getSize()
void setSize(Long size)
default void transferTo(File dest)
default boolean supportTransfer()
Copyright © 2023. All rights reserved.