public abstract class FileBase extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected long |
contentSize
内容大小
|
protected String |
contentType
内容类型(有些地方会动态构建,所以不能只读)
|
protected String |
name
文件名(带扩展名,例:demo.jpg)
|
| Constructor and Description |
|---|
FileBase() |
FileBase(String contentType,
long contentSize,
SupplierEx<InputStream> contentSupplier,
String name)
构造函数
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
InputStream |
getContent()
内容流
|
String |
getContentType()
内容类型
|
String |
getName()
文件名(带扩展名,例:demo.jpg)
|
protected String contentType
protected long contentSize
protected String name
public FileBase()
public FileBase(String contentType, long contentSize, SupplierEx<InputStream> contentSupplier, String name)
contentType - 内容类型contentSize - 内容大小contentSupplier - 内容提供者name - 文件名public String getName()
public String getContentType()
public InputStream getContent()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2025. All rights reserved.