public final class AVFile extends AVObject
AVObject.Hook| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CLASS_NAME |
acl, className, endpointClassName, KEY_ACL, KEY_CLASSNAME, KEY_CREATED_AT, KEY_IGNORE_HOOKS, KEY_OBJECT_ID, KEY_UPDATED_AT, logger, objectId, operations, serverData, totallyOverwrite, UUID_LEN| 限定符 | 构造器和说明 |
|---|---|
|
AVFile()
default constructor.
|
|
AVFile(String name,
byte[] data)
constructor with name and data.
|
|
AVFile(String name,
File localFile)
constructor with name and local file.
|
|
AVFile(String name,
String url)
constructor with name and external url.
|
|
AVFile(String name,
String url,
Map<String,Object> metaData)
constructor with name and external url.
|
protected |
AVFile(String name,
String url,
Map<String,Object> metaData,
boolean external) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addMetaData(String key,
Object val)
Add new meta data.
|
void |
clearMetaData()
Cleanup meta data.
|
boolean |
equals(Object o) |
Object |
get(String key)
Get file attribute.
|
String |
getBucket()
Get file bucket.
|
byte[] |
getData()
Get data in blocking mode.
|
io.reactivex.Observable<byte[]> |
getDataInBackground()
Get data in async mode.
|
InputStream |
getDataStream()
Get data stream in blocking mode.
|
io.reactivex.Observable<InputStream> |
getDataStreamInBackground()
Get data stream in async mode.
|
String |
getKey()
Get file key.
|
Map<String,Object> |
getMetaData()
Get file meta data.
|
Object |
getMetaData(String key)
Get file meta data.
|
String |
getMimeType()
Get file mime type.
|
String |
getName()
Get file name.
|
String |
getProvider()
Get file provider.
|
int |
getSize()
Get file size.
|
String |
getThumbnailUrl(boolean scaleToFit,
int width,
int height)
Returns a thumbnail image url using QiNiu endpoints.
|
String |
getThumbnailUrl(boolean scaleToFit,
int width,
int height,
int quality,
String fmt)
Returns a thumbnail image url using QiNiu endpoints.
|
String |
getUrl()
Get file url.
|
int |
hashCode() |
void |
increment(String key)
Increment file attribute.
|
void |
increment(String key,
Number value)
Increment file attribute.
|
void |
put(String key,
Object value)
Set file attribute.
|
void |
remove(String key)
Remove file attribute.
|
Object |
removeMetaData(String key)
Remove file meta data.
|
void |
save()
save to cloud.
|
void |
save(AVUser asAuthenticatedUser)
save to cloud
|
void |
saveEventually()
Save eventually(not supported).
|
void |
saveEventually(AVUser asAuthenticatedUser)
Save eventually(not supported).
|
io.reactivex.Observable<AVFile> |
saveInBackground()
save to cloud backend.
|
io.reactivex.Observable<AVFile> |
saveInBackground(AVUser asAuthenticatedUser,
boolean keepFileName)
save to cloud in background.
|
void |
saveInBackground(AVUser asAuthenticatedUser,
boolean keepFileName,
ProgressCallback progressCallback)
save to cloud in background.
|
io.reactivex.Observable<AVFile> |
saveInBackground(boolean keepFileName)
save to cloud backend.
|
void |
saveInBackground(boolean keepFileName,
ProgressCallback progressCallback)
save to cloud backend.
|
void |
saveInBackground(ProgressCallback progressCallback)
save to cloud backend.
|
void |
setMetaData(Map<String,Object> metaData)
Set file meta data.
|
void |
setMimeType(String mimeType)
Set file mime type.
|
void |
setName(String name)
Set file name.
|
static void |
setUploadHeader(String key,
String value) |
Map<String,Object> |
toMap()
Get map data of current file.
|
static AVFile |
withAbsoluteLocalPath(String name,
String absoluteLocalFilePath)
Generate File instance with local path.
|
static AVFile |
withFile(String name,
File file)
Generate File instance with local file.
|
static io.reactivex.Observable<AVFile> |
withObjectIdInBackground(String objectId)
Get AVFile instance from objectId.
|
abortOperations, add, addAll, addAllUnique, addNewOperation, addUnique, bitAnd, bitOr, bitXor, cast, containsKey, createWithoutData, createWithoutData, decrement, decrement, delete, delete, deleteAll, deleteAll, deleteAllInBackground, deleteAllInBackground, deleteEventually, deleteEventually, deleteInBackground, deleteInBackground, disableAfterHook, disableBeforeHook, extractCascadingObjects, extractUnsavedFiles, fetch, fetch, fetch, fetchIfNeeded, fetchIfNeededInBackground, fetchIfNeededInBackground, fetchIfNeededInBackground, fetchInBackground, fetchInBackground, fetchInBackground, generateACLFromServerData, generateCascadingSaveObjects, generateChangedParam, getACL, getAVFile, getAVGeoPoint, getAVObject, getBoolean, getBytes, getClassName, getCreatedAt, getCreatedAtString, getDate, getDouble, getInt, getJSONArray, getJSONObject, getList, getLong, getNumber, getObjectId, getQuery, getRelation, getRequestMethod, getRequestRawEndpoint, getServerData, getString, getUnsavedFiles, getUpdatedAt, getUpdatedAtString, getUuid, has, hasCircleReference, ignoreHook, internalClassName, internalGet, internalId, internalPut, isDataAvailable, isFetchWhenSave, onDataSynchronized, onSaveFailure, onSaveSuccess, parseAVObject, refresh, refresh, refresh, refreshInBackground, refreshInBackground, refreshInBackground, refreshInBackground, registerSubclass, removeAll, removeOperationForKey, resetAll, resetByRawData, resetServerData, saveAll, saveAll, saveAllInBackground, saveAllInBackground, saveInBackground, saveInBackground, saveInBackground, setACL, setClassName, setFetchWhenSave, setObjectId, toJSONObject, toJSONString, toString, validFieldName, verifyInternalIdpublic AVFile()
public AVFile(String name, byte[] data)
name - file name.data - binary data.public AVFile(String name, File localFile)
name - file name.localFile - local file.public AVFile(String name, String url)
name - file name.url - external url.public AVFile(String name, String url, Map<String,Object> metaData)
name - file nameurl - external url.metaData - additional attributes.public static io.reactivex.Observable<AVFile> withObjectIdInBackground(String objectId)
objectId - file objectId.public String getName()
public void setName(String name)
name - file name.public void setMetaData(Map<String,Object> metaData)
metaData - meta data.public void addMetaData(String key, Object val)
key - meta key.val - meta value.public Object getMetaData(String key)
key - meta key.public Object removeMetaData(String key)
key - meta key.public void clearMetaData()
public int getSize()
public String getMimeType()
public void setMimeType(String mimeType)
mimeType - mime type.public String getKey()
public String getBucket()
public String getUrl()
public String getProvider()
public void remove(String key)
public void increment(String key)
public String getThumbnailUrl(boolean scaleToFit, int width, int height)
scaleToFit - scale param.width - width.height - height.getThumbnailUrl(boolean, int, int, int, String)public String getThumbnailUrl(boolean scaleToFit, int width, int height, int quality, String fmt)
scaleToFit - scale param.width - widthheight - heightquality - quality.fmt - format string.public void saveInBackground(boolean keepFileName,
ProgressCallback progressCallback)
keepFileName - whether keep file name in url or not.progressCallback - progress callback.public void saveInBackground(AVUser asAuthenticatedUser, boolean keepFileName, ProgressCallback progressCallback)
asAuthenticatedUser - explicit user for request authentication.keepFileName - whether keep file name in url or not.progressCallback - progress callback.
in general, this method should be invoked in lean engine.public void saveInBackground(ProgressCallback progressCallback)
progressCallback - progress callback.public io.reactivex.Observable<AVFile> saveInBackground()
saveInBackground 在类中 AVObjectpublic void save(AVUser asAuthenticatedUser)
public io.reactivex.Observable<AVFile> saveInBackground(boolean keepFileName)
keepFileName - whether keep file name in url or not.public void saveEventually()
throws AVException
saveEventually 在类中 AVObjectAVException - exception happened.
Because that file size is too big, cache the entire data will cost much disk capacity,
so we don't support this method at present.public void saveEventually(AVUser asAuthenticatedUser) throws AVException
saveEventually 在类中 AVObjectasAuthenticatedUser - explicit user for request authentication.AVException - exception happened.
Because that file size is too big, cache the entire data will cost much disk capacity,
so we don't support this method at present.public io.reactivex.Observable<AVFile> saveInBackground(AVUser asAuthenticatedUser, boolean keepFileName)
asAuthenticatedUser - explicit user for request authentication.keepFileName - whether keep file name in url or not.public byte[] getData()
public io.reactivex.Observable<byte[]> getDataInBackground()
public InputStream getDataStream() throws Exception
Exception - for file not found or io problem.public io.reactivex.Observable<InputStream> getDataStreamInBackground()
public static AVFile withAbsoluteLocalPath(String name, String absoluteLocalFilePath) throws FileNotFoundException
name - file nameabsoluteLocalFilePath - local path.FileNotFoundException - file not found.public static AVFile withFile(String name, File file) throws FileNotFoundException
name - file name.file - local file.FileNotFoundException - file not found.Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.