FYunFileServiceInterface.java 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. package com.fdkankan.fyun.face;
  2. import org.springframework.stereotype.Component;
  3. import java.io.IOException;
  4. import java.util.List;
  5. import java.util.Map;
  6. @Component
  7. public interface FYunFileServiceInterface {
  8. String getFyunType();
  9. /**
  10. * 上传文件
  11. *
  12. * @param bucket 目标bucket
  13. * @param data 上传的数据
  14. * @param remoteFilePath 上传后的文件路径
  15. * @
  16. */
  17. void uploadFile(String bucket, byte[] data, String remoteFilePath) ;
  18. /**
  19. * 上传文件至系统默认bucket
  20. *
  21. * @param data 上传的数据
  22. * @param remoteFilePath 上传后的文件路径
  23. * @
  24. */
  25. void uploadFile(byte[] data, String remoteFilePath) ;
  26. /**
  27. * 上传本地文件
  28. *
  29. * @param bucket 目标bucket
  30. * @param filePath 本地路径
  31. * @param remoteFilePath 上传后的文件路径
  32. * @
  33. */
  34. void uploadFile(String bucket, String filePath, String remoteFilePath) ;
  35. /**
  36. * 上传本地文件至系统默认bucket
  37. *
  38. * @param filePath 本地路径
  39. * @param remoteFilePath 上传后的文件路径
  40. * @
  41. */
  42. void uploadFile(String filePath, String remoteFilePath) ;
  43. /**
  44. * 上传本地文件
  45. *
  46. * @param bucket 目标bucket
  47. * @param filePath 本地路径
  48. * @param remoteFilePath 上传后的文件路径
  49. * @
  50. */
  51. void uploadFile(String bucket, String filePath, String remoteFilePath, Map<String, String> headers) ;
  52. /**
  53. * 上传本地文件至系统默认bucket
  54. *
  55. * @param filePath 本地路径
  56. * @param remoteFilePath 上传后的文件路径
  57. * @
  58. */
  59. void uploadFile(String filePath, String remoteFilePath, Map<String, String> headers) ;
  60. /**
  61. * 通过本地脚本上传
  62. *
  63. * @param filePath
  64. * @param remoteFilePath
  65. */
  66. void uploadFileByCommand(String bucket, String filePath, String remoteFilePath) ;
  67. /**
  68. * 通过本地脚本上传至系统默认bucket
  69. *
  70. * @param filePath
  71. * @param remoteFilePath
  72. */
  73. void uploadFileByCommand(String filePath, String remoteFilePath) ;
  74. /**
  75. * 删除服务器文件
  76. *
  77. * @param bucket
  78. * @param remoteFilePath
  79. * @throws IOException
  80. */
  81. void deleteFile(String bucket, String remoteFilePath) throws IOException;
  82. /**
  83. * 删除系统默认bucket服务器文件
  84. *
  85. * @param remoteFilePath
  86. * @throws IOException
  87. */
  88. void deleteFile(String remoteFilePath) throws IOException;
  89. /**
  90. * 删除目录
  91. *
  92. * @param bucket
  93. * @param remoteFolderPath
  94. * @return
  95. */
  96. void deleteFolder(String bucket, String remoteFolderPath) ;
  97. /**
  98. * 删除系统默认bucket目录
  99. *
  100. * @param remoteFolderPath
  101. * @return
  102. */
  103. void deleteFolder(String remoteFolderPath) ;
  104. /**
  105. * 上传多个文件
  106. *
  107. * @param bucket
  108. * @param filepaths :key 本地路径,value,服务器文件路径
  109. * @
  110. */
  111. void uploadMulFiles(String bucket, Map<String, String> filepaths) ;
  112. /**
  113. * 上传多个文件至系统默认bucket
  114. *
  115. * @param filepaths :key 本地路径,value,服务器文件路径
  116. * @
  117. */
  118. void uploadMulFiles(Map<String, String> filepaths) ;
  119. /**
  120. * 获取文件列表
  121. *
  122. * @param bucket
  123. * @param sourcePath
  124. * @return
  125. * @
  126. */
  127. List<String> listRemoteFiles(String bucket, String sourcePath) ;
  128. /**
  129. * 获取默认bucket文件列表
  130. *
  131. * @param sourcePath
  132. * @return
  133. * @
  134. */
  135. List<String> listRemoteFiles(String sourcePath) ;
  136. /**
  137. *
  138. *在指定bucket 内拷贝文件
  139. * @param sourcePath
  140. * @param targetPath
  141. * @author dengsixing
  142. * @date 2022/1/18
  143. **/
  144. void copyFileInBucket(String bucket, String sourcePath, String targetPath) ;
  145. /**
  146. * 在默认bucket 内拷贝文件
  147. * @param sourcePath
  148. * @param targetPath
  149. * @author dengsixing
  150. * @date 2022/1/18
  151. **/
  152. void copyFileInBucket(String sourcePath, String targetPath) ;
  153. /**
  154. * <p>
  155. * 拷贝目录
  156. * </p>
  157. *
  158. * @param sourcePath
  159. * @param targetPath
  160. * @author dengsixing
  161. * @date 2022/1/18
  162. **/
  163. void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) ;
  164. /**
  165. * <p>
  166. * 拷贝系统bucket目录至指定bucket
  167. * </p>
  168. *
  169. * @param sourcePath
  170. * @param targetPath
  171. * @author dengsixing
  172. * @date 2022/1/18
  173. **/
  174. void copyFileBetweenBucket(String sourcePath, String targetBucketName, String targetPath) ;
  175. /**
  176. * <p>
  177. * 拷贝文件
  178. * </p>
  179. *
  180. * @param sourceBucketName
  181. * @param targetBucketName
  182. * @author dengsixing
  183. * @date 2022/1/18
  184. **/
  185. void copyFilesBetweenBucket(String sourceBucketName, String targetBucketName, Map<String, String> pathMap) ;
  186. /**
  187. * <p>
  188. * 拷贝系统bucket目录至指定bucket
  189. * </p>
  190. *
  191. * @param targetBucketName
  192. * @param pathMap
  193. * @author dengsixing
  194. * @date 2022/1/18
  195. **/
  196. void copyFilesBetweenBucket(String targetBucketName, Map<String, String> pathMap) ;
  197. /**
  198. * 获取文件内容
  199. *
  200. * @param bucketName
  201. * @param remoteFilePath
  202. * @return
  203. */
  204. String getFileContent(String bucketName, String remoteFilePath) ;
  205. /**
  206. * 获取默认bucket内容
  207. *
  208. * @param remoteFilePath
  209. * @return
  210. */
  211. String getFileContent(String remoteFilePath) ;
  212. /**
  213. * 判断文件是否存在
  214. *
  215. * @param objectName
  216. * @return
  217. */
  218. boolean fileExist(String bucket, String objectName) ;
  219. /**
  220. * 判断默认bucket文件是否存在
  221. *
  222. * @param objectName
  223. * @return
  224. */
  225. boolean fileExist(String objectName) ;
  226. /**
  227. * 从指定bucket下载文件
  228. *
  229. * @param bucket
  230. * @param remoteFilePath
  231. * @param localPath
  232. * @return
  233. */
  234. public void downloadFile(String bucket, String remoteFilePath, String localPath) ;
  235. /**
  236. * 从系统默认bucket下载文件
  237. *
  238. * @param remoteFilePath
  239. * @param localPath
  240. * @
  241. */
  242. public void downloadFile(String remoteFilePath, String localPath) ;
  243. }