public class ObsFSFile extends ObsFSFolder
innerClient
Constructor and Description |
---|
ObsFSFile(String bucketName,
String objectKey,
String etag,
String versionId,
StorageClassEnum storageClass,
String objectUrl) |
Modifier and Type | Method and Description |
---|---|
ObsFSFile |
append(File file)
在文件末尾追加内容
|
ObsFSFile |
append(InputStream input)
在文件末尾追加内容
|
ObsFSAttribute |
attribute()
获取文件的属性
|
DropFileResult |
drop()
删除文件
|
ReadFileResult |
read()
读取文件内容
|
ReadFileResult |
read(long rangeStart,
long rangeEnd)
读取文件内容
|
RenameResult |
rename(String newName)
重命名文件
|
TruncateFileResult |
truncate(long newLength)
截断文件
|
ObsFSFile |
write(File file)
写文件内容
|
ObsFSFile |
write(File file,
long position)
写文件内容
|
ObsFSFile |
write(InputStream input)
写文件内容
|
ObsFSFile |
write(InputStream input,
long position)
写文件内容
|
checkInternalClient, dropFolder, setInnerClient
getBucketName, getEtag, getObjectKey, getObjectStorageClass, getObjectUrl, getVersionId, toString
getRequestId, getResponseHeaders, getStatusCode
public ObsFSAttribute attribute() throws ObsException
attribute
in class ObsFSFolder
ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ReadFileResult read() throws ObsException
ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ReadFileResult read(long rangeStart, long rangeEnd) throws ObsException
rangeStart
- 读取文件内容的起始位置rangeEnd
- 读取文件内容的结束位置ObsException
public ObsFSFile write(File file, long position) throws ObsException
file
- 本地文件路径position
- 写文件的起始位置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsFSFile write(File file) throws ObsException
file
- 本地文件路径ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsFSFile write(InputStream input, long position) throws ObsException
input
- 待上传的数据流position
- 写文件的起始位置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsFSFile append(File file) throws ObsException
file
- 本地文件路径ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsFSFile append(InputStream input) throws ObsException
input
- 待上传的数据流ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsFSFile write(InputStream input) throws ObsException
input
- 待上传的数据流ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public RenameResult rename(String newName) throws ObsException
rename
in class ObsFSFolder
newName
- 新的文件名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public TruncateFileResult truncate(long newLength) throws ObsException
newLength
- 文件截断后的大小ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public DropFileResult drop() throws ObsException
ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常Copyright © 2021. All rights reserved.