public class FileStorageHttp extends Object implements FileStorage
| 构造器和说明 |
|---|
FileStorageHttp(FileStorageHttpConfig config) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
delete(String filePath,
boolean compression)
删除文件
|
InputStream |
getStream(String filePath,
boolean compression)
读取文件
|
long |
length(String filePath,
boolean compression)
获取文件长度(注意:若文件不存在,返回-1, 若配置有压缩,可能返回的长度小于实际内容长度)
|
long |
save(InputStream inputStream,
String filePath,
boolean compression)
存储文件
|
protected void |
setupAuth(HttpURLConnection connection) |
protected void |
setupConnection(HttpURLConnection connection) |
protected void |
setupTimeout(HttpURLConnection connection) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompressionPathStarts, delete, enable, getData, getStream, getString, isCompression, length, save, save, save, tryDelete, tryDeletepublic FileStorageHttp(FileStorageHttpConfig config)
protected void setupTimeout(HttpURLConnection connection)
protected void setupAuth(HttpURLConnection connection)
protected void setupConnection(HttpURLConnection connection)
public long save(InputStream inputStream, String filePath, boolean compression) throws IOException
FileStoragesave 在接口中 FileStorageIOExceptionpublic InputStream getStream(String filePath, boolean compression) throws IOException
FileStoragegetStream 在接口中 FileStorageIOExceptionpublic void delete(String filePath, boolean compression) throws IOException
FileStoragedelete 在接口中 FileStorageIOExceptionpublic long length(String filePath, boolean compression) throws IOException
FileStoragelength 在接口中 FileStorageIOExceptionCopyright © 2025. All rights reserved.