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)
Append data to a file.
|
ObsFSFile |
append(InputStream input)
Append data to a file.
|
ObsFSAttribute |
attribute()
Obtains file properties.
|
DropFileResult |
drop()
Delete a file.
|
ReadFileResult |
read()
Obtain the file content.
|
ReadFileResult |
read(long rangeStart,
long rangeEnd)
Obtain the file content.
|
RenameResult |
rename(String newName)
Rename a file.
|
TruncateFileResult |
truncate(long newLength)
Truncate a file.
|
ObsFSFile |
write(File file)
Write data to a file.
|
ObsFSFile |
write(File file,
long position)
Write data to a file.
|
ObsFSFile |
write(InputStream input)
Write data to a file.
|
ObsFSFile |
write(InputStream input,
long position)
Write data to a file.
|
checkInternalClient, dropFolder, finalize
getBucketName, getEtag, getObjectKey, getObjectStorageClass, getObjectUrl, getVersionId, toString
getRequestId, getResponseHeaders, getStatusCode
public ObsFSAttribute attribute() throws ObsException
attribute
in class ObsFSFolder
ObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ReadFileResult read() throws ObsException
ObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ReadFileResult read(long rangeStart, long rangeEnd) throws ObsException
rangeStart
- Start position for reading file contentrangeEnd
- End position for reading file contentObsException
public ObsFSFile write(File file, long position) throws ObsException
file
- Local path to the fileposition
- Start position for writing data to a fileObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ObsFSFile write(File file) throws ObsException
file
- Local path to the fileObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ObsFSFile write(InputStream input, long position) throws ObsException
input
- Data stream to be uploadedposition
- Start position for writing data to a fileObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ObsFSFile append(File file) throws ObsException
file
- Local path to the fileObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ObsFSFile append(InputStream input) throws ObsException
input
- Data stream to be uploadedObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic ObsFSFile write(InputStream input) throws ObsException
input
- Data stream to be uploadedObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic RenameResult rename(String newName) throws ObsException
rename
in class ObsFSFolder
newName
- New file nameObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic TruncateFileResult truncate(long newLength) throws ObsException
newLength
- File size after the truncationObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failspublic DropFileResult drop() throws ObsException
ObsException
- OBS SDK self-defined exception, thrown when the interface fails to be called or access to OBS failsCopyright © 2019. All rights reserved.