NIMSDK-AOS 10.4.0-beta
载入中...
搜索中...
未找到
V2NIMUploadFileParams.java
浏览该文件的文档.
1package com.netease.nimlib.sdk.v2.storage;
2
3import android.text.TextUtils;
4
5/**
6 * 文件上传参数
7 */
9
10 /**
11 * 文件地址
12 */
13 private final String filePath;
14 /**
15 * 场景名
16 * 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值
17 * 默认使用{@link V2NIMStorageSceneConfig#DEFAULT_PROFILE}对应的场景名
18 */
19 private final String sceneName;
20
22 this.filePath = null;
23 this.sceneName = null;
24 }
25
26 /**
27 * @param filePath 文件地址
28 */
29 public V2NIMUploadFileParams(String filePath) {
30 this.filePath = filePath;
31 this.sceneName = null;
32 }
33
34 /**
35 * @param filePath 文件地址
36 * @param sceneName 场景名
37 */
38 public V2NIMUploadFileParams(String filePath, String sceneName) {
39 this.filePath = filePath;
40 this.sceneName = sceneName;
41 }
42
43 /**
44 * 返回文件地址
45 * @return 文件地址
46 */
47 public String getFilePath() {
48 return filePath;
49 }
50
51
52 /**
53 * 返回场景名
54 * @return 场景名
55 */
56 public String getSceneName() {
57 if(TextUtils.isEmpty(sceneName)){
59 }
60 return sceneName;
61 }
62
63 /**
64 * 返回是否有效
65 * @return
66 */
67 public boolean isValid() {
68 return filePath != null && !filePath.isEmpty();
69 }
70
71}
static final V2NIMStorageScene DEFAULT_PROFILE
默认头像类型等场景 默认不过期