NIMSDK-AOS  9.16.0
Public 成员函数 | 所有成员列表
com.netease.nimlib.sdk.nos.NosService接口 参考

网易云存储服务 更多...

Public 成员函数

AbortableFuture< String > upload (File file, String mimeType)
 使用默认的nos scene NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE上传文件 参考 uploadAtScene(File, String, String) 更多...
 
AbortableFuture< String > uploadAtScene (File file, String mimeType, String sceneKey)
 upload(File, String)功能一样,不过指定了上传文件时用的nos scene 更多...
 
AbortableFuture< String > uploadEnableForce (File file, String mimeType, String sceneKey, boolean enableForceUploadFile)
 upload(File, String)功能一样,不过指定了上传文件时用的nos scene 以及是否需要强制重新上传文件 更多...
 
AbortableFuture< Void > download (String url, NosThumbParam thumb, String path)
 下载文件 更多...
 
AbortableFuture< Void > downloadFileSecure (String url, String path)
 通过安全链接下载文件 更多...
 
String convertDownloadUrlToCDNUrl (String url)
 将文件url 转换成CDN 加速url ,如果不支持,返回原链接 更多...
 
InvocationFuture< String > getOriginUrlFromShortUrl (String shortUrl)
 针对开启了NOS 文件安全功能的用户,可能通过短链获取原始链接,注意保护原始链接不要外泄 更多...
 
InvocationFuture< String > getOriginUrlFromShortUrl (String roomId, String shortUrl)
 针对开启了NOS 文件安全功能的用户,可能通过短链获取原始链接,注意保护原始链接不要外泄 更多...
 

详细描述

网易云存储服务

在文件 NosService.java17 行定义.

成员函数说明

◆ convertDownloadUrlToCDNUrl()

String com.netease.nimlib.sdk.nos.NosService.convertDownloadUrlToCDNUrl ( String  url)

将文件url 转换成CDN 加速url ,如果不支持,返回原链接

参数
url原始链接
返回
CDN 加速链接,如果不支持,返回原链接

◆ download()

AbortableFuture<Void> com.netease.nimlib.sdk.nos.NosService.download ( String  url,
NosThumbParam  thumb,
String  path 
)

下载文件

参数
url文件url
thumb缩略图配置
path下载保存路径
返回
AbortableFuture

◆ downloadFileSecure()

AbortableFuture<Void> com.netease.nimlib.sdk.nos.NosService.downloadFileSecure ( String  url,
String  path 
)

通过安全链接下载文件

参数
url文件url
path下载保存路径
返回
AbortableFuture

◆ getOriginUrlFromShortUrl() [1/2]

InvocationFuture<String> com.netease.nimlib.sdk.nos.NosService.getOriginUrlFromShortUrl ( String  shortUrl)

针对开启了NOS 文件安全功能的用户,可能通过短链获取原始链接,注意保护原始链接不要外泄

参数
shortUrl短链 ,如果参数不是长链,返回414
返回
InvocationFuture

◆ getOriginUrlFromShortUrl() [2/2]

InvocationFuture<String> com.netease.nimlib.sdk.nos.NosService.getOriginUrlFromShortUrl ( String  roomId,
String  shortUrl 
)

针对开启了NOS 文件安全功能的用户,可能通过短链获取原始链接,注意保护原始链接不要外泄

参数
roomId聊天室id
shortUrl短链 ,如果参数不是长链,返回414
返回
InvocationFuture

◆ upload()

AbortableFuture<String> com.netease.nimlib.sdk.nos.NosService.upload ( File  file,
String  mimeType 
)

使用默认的nos scene NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE上传文件 参考 uploadAtScene(File, String, String)

参数
filefile
mimeTypefile type
返回
AbortableFuture

◆ uploadAtScene()

AbortableFuture<String> com.netease.nimlib.sdk.nos.NosService.uploadAtScene ( File  file,
String  mimeType,
String  sceneKey 
)

upload(File, String)功能一样,不过指定了上传文件时用的nos scene

参数
filefile
mimeTypefile type
sceneKey上传文件时用的nos sceneKey ,默认值:NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE , nos token scene 配置参考NosTokenSceneConfig
返回
AbortableFuture

◆ uploadEnableForce()

AbortableFuture<String> com.netease.nimlib.sdk.nos.NosService.uploadEnableForce ( File  file,
String  mimeType,
String  sceneKey,
boolean  enableForceUploadFile 
)

upload(File, String)功能一样,不过指定了上传文件时用的nos scene 以及是否需要强制重新上传文件

参数
filefile
mimeTypefile type
sceneKey上传文件时用的nos sceneKey ,默认值:NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE , nos token scene 配置参考NosTokenSceneConfig
enableForceUploadFile如果服务器存在相同的文件,是否强制重新上传文件 ,默认false
返回
AbortableFuture

该接口的文档由以下文件生成: