no message
Showing
1 changed file
with
104 additions
and
77 deletions
| ... | @@ -117,14 +117,16 @@ public class CourseController extends BaseController { | ... | @@ -117,14 +117,16 @@ public class CourseController extends BaseController { |
| 117 | } | 117 | } |
| 118 | byteArrayOutputStream.flush(); | 118 | byteArrayOutputStream.flush(); |
| 119 | fileBytes = byteArrayOutputStream.toByteArray(); | 119 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 120 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 121 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 120 | } catch (IOException e) { | 122 | } catch (IOException e) { |
| 121 | System.out.println(e.getMessage()); | 123 | System.out.println(e.getMessage()); |
| 122 | } | 124 | } |
| 123 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | 125 | |
| 124 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 125 | } else if (".mp4".equals(suffix)) { | 126 | } else if (".mp4".equals(suffix)) { |
| 126 | byte[] fileBytes = null; | 127 | byte[] fileBytes = null; |
| 127 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 128 | try { |
| 129 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 128 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 130 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 129 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 131 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 130 | int bytesRead; | 132 | int bytesRead; |
| ... | @@ -133,14 +135,16 @@ public class CourseController extends BaseController { | ... | @@ -133,14 +135,16 @@ public class CourseController extends BaseController { |
| 133 | } | 135 | } |
| 134 | byteArrayOutputStream.flush(); | 136 | byteArrayOutputStream.flush(); |
| 135 | fileBytes = byteArrayOutputStream.toByteArray(); | 137 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 138 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 139 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 136 | } catch (IOException e) { | 140 | } catch (IOException e) { |
| 137 | System.out.println(e.getMessage()); | 141 | System.out.println(e.getMessage()); |
| 138 | } | 142 | } |
| 139 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | 143 | |
| 140 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 141 | } else if (".json".equals(suffix)) { | 144 | } else if (".json".equals(suffix)) { |
| 142 | byte[] fileBytes = null; | 145 | byte[] fileBytes = null; |
| 143 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 146 | try { |
| 147 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 144 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 148 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 145 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 149 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 146 | int bytesRead; | 150 | int bytesRead; |
| ... | @@ -149,14 +153,15 @@ public class CourseController extends BaseController { | ... | @@ -149,14 +153,15 @@ public class CourseController extends BaseController { |
| 149 | } | 153 | } |
| 150 | byteArrayOutputStream.flush(); | 154 | byteArrayOutputStream.flush(); |
| 151 | fileBytes = byteArrayOutputStream.toByteArray(); | 155 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 156 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 157 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 152 | } catch (IOException e) { | 158 | } catch (IOException e) { |
| 153 | System.out.println(e.getMessage()); | 159 | System.out.println(e.getMessage()); |
| 154 | } | 160 | } |
| 155 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 156 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 157 | } else if (".ldr".equals(suffix)) { | 161 | } else if (".ldr".equals(suffix)) { |
| 158 | byte[] fileBytes = null; | 162 | byte[] fileBytes = null; |
| 159 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 163 | try { |
| 164 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 160 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 165 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 161 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 166 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 162 | int bytesRead; | 167 | int bytesRead; |
| ... | @@ -165,11 +170,11 @@ public class CourseController extends BaseController { | ... | @@ -165,11 +170,11 @@ public class CourseController extends BaseController { |
| 165 | } | 170 | } |
| 166 | byteArrayOutputStream.flush(); | 171 | byteArrayOutputStream.flush(); |
| 167 | fileBytes = byteArrayOutputStream.toByteArray(); | 172 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 173 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 174 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 168 | } catch (IOException e) { | 175 | } catch (IOException e) { |
| 169 | System.out.println(e.getMessage()); | 176 | System.out.println(e.getMessage()); |
| 170 | } | 177 | } |
| 171 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 172 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 173 | } | 178 | } |
| 174 | if (Objects.nonNull(uploadResult)) { | 179 | if (Objects.nonNull(uploadResult)) { |
| 175 | // 保存文件信息 | 180 | // 保存文件信息 |
| ... | @@ -215,14 +220,15 @@ public class CourseController extends BaseController { | ... | @@ -215,14 +220,15 @@ public class CourseController extends BaseController { |
| 215 | } | 220 | } |
| 216 | byteArrayOutputStream.flush(); | 221 | byteArrayOutputStream.flush(); |
| 217 | fileBytes = byteArrayOutputStream.toByteArray(); | 222 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 223 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 224 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 218 | } catch (IOException e) { | 225 | } catch (IOException e) { |
| 219 | System.out.println(e.getMessage()); | 226 | System.out.println(e.getMessage()); |
| 220 | } | 227 | } |
| 221 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 222 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 223 | } else if (".mp4".equals(suffix)) { | 228 | } else if (".mp4".equals(suffix)) { |
| 224 | byte[] fileBytes = null; | 229 | byte[] fileBytes = null; |
| 225 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 230 | try { |
| 231 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 226 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 232 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 227 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 233 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 228 | int bytesRead; | 234 | int bytesRead; |
| ... | @@ -231,14 +237,15 @@ public class CourseController extends BaseController { | ... | @@ -231,14 +237,15 @@ public class CourseController extends BaseController { |
| 231 | } | 237 | } |
| 232 | byteArrayOutputStream.flush(); | 238 | byteArrayOutputStream.flush(); |
| 233 | fileBytes = byteArrayOutputStream.toByteArray(); | 239 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 240 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 241 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 234 | } catch (IOException e) { | 242 | } catch (IOException e) { |
| 235 | System.out.println(e.getMessage()); | 243 | System.out.println(e.getMessage()); |
| 236 | } | 244 | } |
| 237 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 238 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 239 | } else if (".json".equals(suffix)) { | 245 | } else if (".json".equals(suffix)) { |
| 240 | byte[] fileBytes = null; | 246 | byte[] fileBytes = null; |
| 241 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 247 | try { |
| 248 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 242 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 249 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 243 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 250 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 244 | int bytesRead; | 251 | int bytesRead; |
| ... | @@ -247,14 +254,15 @@ public class CourseController extends BaseController { | ... | @@ -247,14 +254,15 @@ public class CourseController extends BaseController { |
| 247 | } | 254 | } |
| 248 | byteArrayOutputStream.flush(); | 255 | byteArrayOutputStream.flush(); |
| 249 | fileBytes = byteArrayOutputStream.toByteArray(); | 256 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 257 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 258 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 250 | } catch (IOException e) { | 259 | } catch (IOException e) { |
| 251 | System.out.println(e.getMessage()); | 260 | System.out.println(e.getMessage()); |
| 252 | } | 261 | } |
| 253 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 254 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 255 | } else if (".ldr".equals(suffix)) { | 262 | } else if (".ldr".equals(suffix)) { |
| 256 | byte[] fileBytes = null; | 263 | byte[] fileBytes = null; |
| 257 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 264 | try { |
| 265 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 258 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 266 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 259 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 267 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 260 | int bytesRead; | 268 | int bytesRead; |
| ... | @@ -263,11 +271,11 @@ public class CourseController extends BaseController { | ... | @@ -263,11 +271,11 @@ public class CourseController extends BaseController { |
| 263 | } | 271 | } |
| 264 | byteArrayOutputStream.flush(); | 272 | byteArrayOutputStream.flush(); |
| 265 | fileBytes = byteArrayOutputStream.toByteArray(); | 273 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 274 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 275 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 266 | } catch (IOException e) { | 276 | } catch (IOException e) { |
| 267 | System.out.println(e.getMessage()); | 277 | System.out.println(e.getMessage()); |
| 268 | } | 278 | } |
| 269 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 270 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 271 | } | 279 | } |
| 272 | if (Objects.nonNull(uploadResult)) { | 280 | if (Objects.nonNull(uploadResult)) { |
| 273 | // 保存文件信息 | 281 | // 保存文件信息 |
| ... | @@ -313,14 +321,15 @@ public class CourseController extends BaseController { | ... | @@ -313,14 +321,15 @@ public class CourseController extends BaseController { |
| 313 | } | 321 | } |
| 314 | byteArrayOutputStream.flush(); | 322 | byteArrayOutputStream.flush(); |
| 315 | fileBytes = byteArrayOutputStream.toByteArray(); | 323 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 324 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 325 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 316 | } catch (IOException e) { | 326 | } catch (IOException e) { |
| 317 | System.out.println(e.getMessage()); | 327 | System.out.println(e.getMessage()); |
| 318 | } | 328 | } |
| 319 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 320 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 321 | } else if (".mp4".equals(suffix)) { | 329 | } else if (".mp4".equals(suffix)) { |
| 322 | byte[] fileBytes = null; | 330 | byte[] fileBytes = null; |
| 323 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 331 | try { |
| 332 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 324 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 333 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 325 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 334 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 326 | int bytesRead; | 335 | int bytesRead; |
| ... | @@ -329,14 +338,15 @@ public class CourseController extends BaseController { | ... | @@ -329,14 +338,15 @@ public class CourseController extends BaseController { |
| 329 | } | 338 | } |
| 330 | byteArrayOutputStream.flush(); | 339 | byteArrayOutputStream.flush(); |
| 331 | fileBytes = byteArrayOutputStream.toByteArray(); | 340 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 341 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 342 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 332 | } catch (IOException e) { | 343 | } catch (IOException e) { |
| 333 | System.out.println(e.getMessage()); | 344 | System.out.println(e.getMessage()); |
| 334 | } | 345 | } |
| 335 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 336 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 337 | } else if (".json".equals(suffix)) { | 346 | } else if (".json".equals(suffix)) { |
| 338 | byte[] fileBytes = null; | 347 | byte[] fileBytes = null; |
| 339 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 348 | try { |
| 349 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 340 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 350 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 341 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 351 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 342 | int bytesRead; | 352 | int bytesRead; |
| ... | @@ -345,14 +355,15 @@ public class CourseController extends BaseController { | ... | @@ -345,14 +355,15 @@ public class CourseController extends BaseController { |
| 345 | } | 355 | } |
| 346 | byteArrayOutputStream.flush(); | 356 | byteArrayOutputStream.flush(); |
| 347 | fileBytes = byteArrayOutputStream.toByteArray(); | 357 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 358 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 359 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 348 | } catch (IOException e) { | 360 | } catch (IOException e) { |
| 349 | System.out.println(e.getMessage()); | 361 | System.out.println(e.getMessage()); |
| 350 | } | 362 | } |
| 351 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 352 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 353 | } else if (".ldr".equals(suffix)) { | 363 | } else if (".ldr".equals(suffix)) { |
| 354 | byte[] fileBytes = null; | 364 | byte[] fileBytes = null; |
| 355 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 365 | try { |
| 366 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 356 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 367 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 357 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 368 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 358 | int bytesRead; | 369 | int bytesRead; |
| ... | @@ -361,11 +372,11 @@ public class CourseController extends BaseController { | ... | @@ -361,11 +372,11 @@ public class CourseController extends BaseController { |
| 361 | } | 372 | } |
| 362 | byteArrayOutputStream.flush(); | 373 | byteArrayOutputStream.flush(); |
| 363 | fileBytes = byteArrayOutputStream.toByteArray(); | 374 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 375 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 376 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 364 | } catch (IOException e) { | 377 | } catch (IOException e) { |
| 365 | System.out.println(e.getMessage()); | 378 | System.out.println(e.getMessage()); |
| 366 | } | 379 | } |
| 367 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 368 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 369 | } | 380 | } |
| 370 | if (Objects.nonNull(uploadResult)) { | 381 | if (Objects.nonNull(uploadResult)) { |
| 371 | // 保存文件信息 | 382 | // 保存文件信息 |
| ... | @@ -411,14 +422,15 @@ public class CourseController extends BaseController { | ... | @@ -411,14 +422,15 @@ public class CourseController extends BaseController { |
| 411 | } | 422 | } |
| 412 | byteArrayOutputStream.flush(); | 423 | byteArrayOutputStream.flush(); |
| 413 | fileBytes = byteArrayOutputStream.toByteArray(); | 424 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 425 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 426 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 414 | } catch (IOException e) { | 427 | } catch (IOException e) { |
| 415 | System.out.println(e.getMessage()); | 428 | System.out.println(e.getMessage()); |
| 416 | } | 429 | } |
| 417 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 418 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 419 | } else if (".mp4".equals(suffix)) { | 430 | } else if (".mp4".equals(suffix)) { |
| 420 | byte[] fileBytes = null; | 431 | byte[] fileBytes = null; |
| 421 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 432 | try { |
| 433 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 422 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 434 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 423 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 435 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 424 | int bytesRead; | 436 | int bytesRead; |
| ... | @@ -427,14 +439,15 @@ public class CourseController extends BaseController { | ... | @@ -427,14 +439,15 @@ public class CourseController extends BaseController { |
| 427 | } | 439 | } |
| 428 | byteArrayOutputStream.flush(); | 440 | byteArrayOutputStream.flush(); |
| 429 | fileBytes = byteArrayOutputStream.toByteArray(); | 441 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 442 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 443 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 430 | } catch (IOException e) { | 444 | } catch (IOException e) { |
| 431 | System.out.println(e.getMessage()); | 445 | System.out.println(e.getMessage()); |
| 432 | } | 446 | } |
| 433 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 434 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 435 | } else if (".json".equals(suffix)) { | 447 | } else if (".json".equals(suffix)) { |
| 436 | byte[] fileBytes = null; | 448 | byte[] fileBytes = null; |
| 437 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 449 | try { |
| 450 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 438 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 451 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 439 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 452 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 440 | int bytesRead; | 453 | int bytesRead; |
| ... | @@ -443,14 +456,15 @@ public class CourseController extends BaseController { | ... | @@ -443,14 +456,15 @@ public class CourseController extends BaseController { |
| 443 | } | 456 | } |
| 444 | byteArrayOutputStream.flush(); | 457 | byteArrayOutputStream.flush(); |
| 445 | fileBytes = byteArrayOutputStream.toByteArray(); | 458 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 459 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 460 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 446 | } catch (IOException e) { | 461 | } catch (IOException e) { |
| 447 | System.out.println(e.getMessage()); | 462 | System.out.println(e.getMessage()); |
| 448 | } | 463 | } |
| 449 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 450 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 451 | } else if (".ldr".equals(suffix)) { | 464 | } else if (".ldr".equals(suffix)) { |
| 452 | byte[] fileBytes = null; | 465 | byte[] fileBytes = null; |
| 453 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 466 | try { |
| 467 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 454 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 468 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 455 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 469 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 456 | int bytesRead; | 470 | int bytesRead; |
| ... | @@ -459,11 +473,11 @@ public class CourseController extends BaseController { | ... | @@ -459,11 +473,11 @@ public class CourseController extends BaseController { |
| 459 | } | 473 | } |
| 460 | byteArrayOutputStream.flush(); | 474 | byteArrayOutputStream.flush(); |
| 461 | fileBytes = byteArrayOutputStream.toByteArray(); | 475 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 476 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 477 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 462 | } catch (IOException e) { | 478 | } catch (IOException e) { |
| 463 | System.out.println(e.getMessage()); | 479 | System.out.println(e.getMessage()); |
| 464 | } | 480 | } |
| 465 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 466 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 467 | } | 481 | } |
| 468 | if (Objects.nonNull(uploadResult)) { | 482 | if (Objects.nonNull(uploadResult)) { |
| 469 | // 保存文件信息 | 483 | // 保存文件信息 |
| ... | @@ -509,14 +523,15 @@ public class CourseController extends BaseController { | ... | @@ -509,14 +523,15 @@ public class CourseController extends BaseController { |
| 509 | } | 523 | } |
| 510 | byteArrayOutputStream.flush(); | 524 | byteArrayOutputStream.flush(); |
| 511 | fileBytes = byteArrayOutputStream.toByteArray(); | 525 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 526 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 527 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 512 | } catch (IOException e) { | 528 | } catch (IOException e) { |
| 513 | System.out.println(e.getMessage()); | 529 | System.out.println(e.getMessage()); |
| 514 | } | 530 | } |
| 515 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 516 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 517 | } else if (".mp4".equals(suffix)) { | 531 | } else if (".mp4".equals(suffix)) { |
| 518 | byte[] fileBytes = null; | 532 | byte[] fileBytes = null; |
| 519 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 533 | try { |
| 534 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 520 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 535 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 521 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 536 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 522 | int bytesRead; | 537 | int bytesRead; |
| ... | @@ -525,14 +540,15 @@ public class CourseController extends BaseController { | ... | @@ -525,14 +540,15 @@ public class CourseController extends BaseController { |
| 525 | } | 540 | } |
| 526 | byteArrayOutputStream.flush(); | 541 | byteArrayOutputStream.flush(); |
| 527 | fileBytes = byteArrayOutputStream.toByteArray(); | 542 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 543 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 544 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 528 | } catch (IOException e) { | 545 | } catch (IOException e) { |
| 529 | System.out.println(e.getMessage()); | 546 | System.out.println(e.getMessage()); |
| 530 | } | 547 | } |
| 531 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 532 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 533 | } else if (".json".equals(suffix)) { | 548 | } else if (".json".equals(suffix)) { |
| 534 | byte[] fileBytes = null; | 549 | byte[] fileBytes = null; |
| 535 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 550 | try { |
| 551 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 536 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 552 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 537 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 553 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 538 | int bytesRead; | 554 | int bytesRead; |
| ... | @@ -541,14 +557,15 @@ public class CourseController extends BaseController { | ... | @@ -541,14 +557,15 @@ public class CourseController extends BaseController { |
| 541 | } | 557 | } |
| 542 | byteArrayOutputStream.flush(); | 558 | byteArrayOutputStream.flush(); |
| 543 | fileBytes = byteArrayOutputStream.toByteArray(); | 559 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 560 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 561 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 544 | } catch (IOException e) { | 562 | } catch (IOException e) { |
| 545 | System.out.println(e.getMessage()); | 563 | System.out.println(e.getMessage()); |
| 546 | } | 564 | } |
| 547 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 548 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 549 | } else if (".ldr".equals(suffix)) { | 565 | } else if (".ldr".equals(suffix)) { |
| 550 | byte[] fileBytes = null; | 566 | byte[] fileBytes = null; |
| 551 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 567 | try { |
| 568 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 552 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 569 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 553 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 570 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 554 | int bytesRead; | 571 | int bytesRead; |
| ... | @@ -557,11 +574,11 @@ public class CourseController extends BaseController { | ... | @@ -557,11 +574,11 @@ public class CourseController extends BaseController { |
| 557 | } | 574 | } |
| 558 | byteArrayOutputStream.flush(); | 575 | byteArrayOutputStream.flush(); |
| 559 | fileBytes = byteArrayOutputStream.toByteArray(); | 576 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 577 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 578 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 560 | } catch (IOException e) { | 579 | } catch (IOException e) { |
| 561 | System.out.println(e.getMessage()); | 580 | System.out.println(e.getMessage()); |
| 562 | } | 581 | } |
| 563 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 564 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 565 | } | 582 | } |
| 566 | if (Objects.nonNull(uploadResult)) { | 583 | if (Objects.nonNull(uploadResult)) { |
| 567 | // 保存文件信息 | 584 | // 保存文件信息 |
| ... | @@ -607,14 +624,15 @@ public class CourseController extends BaseController { | ... | @@ -607,14 +624,15 @@ public class CourseController extends BaseController { |
| 607 | } | 624 | } |
| 608 | byteArrayOutputStream.flush(); | 625 | byteArrayOutputStream.flush(); |
| 609 | fileBytes = byteArrayOutputStream.toByteArray(); | 626 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 627 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 628 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 610 | } catch (IOException e) { | 629 | } catch (IOException e) { |
| 611 | System.out.println(e.getMessage()); | 630 | System.out.println(e.getMessage()); |
| 612 | } | 631 | } |
| 613 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 614 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 615 | } else if (".mp4".equals(suffix)) { | 632 | } else if (".mp4".equals(suffix)) { |
| 616 | byte[] fileBytes = null; | 633 | byte[] fileBytes = null; |
| 617 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 634 | try { |
| 635 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 618 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 636 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 619 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 637 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 620 | int bytesRead; | 638 | int bytesRead; |
| ... | @@ -623,14 +641,15 @@ public class CourseController extends BaseController { | ... | @@ -623,14 +641,15 @@ public class CourseController extends BaseController { |
| 623 | } | 641 | } |
| 624 | byteArrayOutputStream.flush(); | 642 | byteArrayOutputStream.flush(); |
| 625 | fileBytes = byteArrayOutputStream.toByteArray(); | 643 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 644 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 645 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 626 | } catch (IOException e) { | 646 | } catch (IOException e) { |
| 627 | System.out.println(e.getMessage()); | 647 | System.out.println(e.getMessage()); |
| 628 | } | 648 | } |
| 629 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 630 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 631 | } else if (".json".equals(suffix)) { | 649 | } else if (".json".equals(suffix)) { |
| 632 | byte[] fileBytes = null; | 650 | byte[] fileBytes = null; |
| 633 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 651 | try { |
| 652 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 634 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 653 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 635 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 654 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 636 | int bytesRead; | 655 | int bytesRead; |
| ... | @@ -639,14 +658,15 @@ public class CourseController extends BaseController { | ... | @@ -639,14 +658,15 @@ public class CourseController extends BaseController { |
| 639 | } | 658 | } |
| 640 | byteArrayOutputStream.flush(); | 659 | byteArrayOutputStream.flush(); |
| 641 | fileBytes = byteArrayOutputStream.toByteArray(); | 660 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 661 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 662 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 642 | } catch (IOException e) { | 663 | } catch (IOException e) { |
| 643 | System.out.println(e.getMessage()); | 664 | System.out.println(e.getMessage()); |
| 644 | } | 665 | } |
| 645 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 646 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 647 | } else if (".ldr".equals(suffix)) { | 666 | } else if (".ldr".equals(suffix)) { |
| 648 | byte[] fileBytes = null; | 667 | byte[] fileBytes = null; |
| 649 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 668 | try { |
| 669 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 650 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 670 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 651 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 671 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 652 | int bytesRead; | 672 | int bytesRead; |
| ... | @@ -655,11 +675,11 @@ public class CourseController extends BaseController { | ... | @@ -655,11 +675,11 @@ public class CourseController extends BaseController { |
| 655 | } | 675 | } |
| 656 | byteArrayOutputStream.flush(); | 676 | byteArrayOutputStream.flush(); |
| 657 | fileBytes = byteArrayOutputStream.toByteArray(); | 677 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 678 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 679 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 658 | } catch (IOException e) { | 680 | } catch (IOException e) { |
| 659 | System.out.println(e.getMessage()); | 681 | System.out.println(e.getMessage()); |
| 660 | } | 682 | } |
| 661 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 662 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 663 | } | 683 | } |
| 664 | if (Objects.nonNull(uploadResult)) { | 684 | if (Objects.nonNull(uploadResult)) { |
| 665 | // 保存文件信息 | 685 | // 保存文件信息 |
| ... | @@ -705,14 +725,16 @@ public class CourseController extends BaseController { | ... | @@ -705,14 +725,16 @@ public class CourseController extends BaseController { |
| 705 | } | 725 | } |
| 706 | byteArrayOutputStream.flush(); | 726 | byteArrayOutputStream.flush(); |
| 707 | fileBytes = byteArrayOutputStream.toByteArray(); | 727 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 728 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 729 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 708 | } catch (IOException e) { | 730 | } catch (IOException e) { |
| 709 | System.out.println(e.getMessage()); | 731 | System.out.println(e.getMessage()); |
| 710 | } | 732 | } |
| 711 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | 733 | |
| 712 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "application/pdf"); | ||
| 713 | } else if (".mp4".equals(suffix)) { | 734 | } else if (".mp4".equals(suffix)) { |
| 714 | byte[] fileBytes = null; | 735 | byte[] fileBytes = null; |
| 715 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 736 | try { |
| 737 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 716 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 738 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 717 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 739 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 718 | int bytesRead; | 740 | int bytesRead; |
| ... | @@ -721,14 +743,16 @@ public class CourseController extends BaseController { | ... | @@ -721,14 +743,16 @@ public class CourseController extends BaseController { |
| 721 | } | 743 | } |
| 722 | byteArrayOutputStream.flush(); | 744 | byteArrayOutputStream.flush(); |
| 723 | fileBytes = byteArrayOutputStream.toByteArray(); | 745 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 746 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 747 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 724 | } catch (IOException e) { | 748 | } catch (IOException e) { |
| 725 | System.out.println(e.getMessage()); | 749 | System.out.println(e.getMessage()); |
| 726 | } | 750 | } |
| 727 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | 751 | |
| 728 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "video/mpeg4"); | ||
| 729 | } else if (".json".equals(suffix)) { | 752 | } else if (".json".equals(suffix)) { |
| 730 | byte[] fileBytes = null; | 753 | byte[] fileBytes = null; |
| 731 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 754 | try { |
| 755 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 732 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 756 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 733 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 757 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 734 | int bytesRead; | 758 | int bytesRead; |
| ... | @@ -737,14 +761,16 @@ public class CourseController extends BaseController { | ... | @@ -737,14 +761,16 @@ public class CourseController extends BaseController { |
| 737 | } | 761 | } |
| 738 | byteArrayOutputStream.flush(); | 762 | byteArrayOutputStream.flush(); |
| 739 | fileBytes = byteArrayOutputStream.toByteArray(); | 763 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 764 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 765 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 740 | } catch (IOException e) { | 766 | } catch (IOException e) { |
| 741 | System.out.println(e.getMessage()); | 767 | System.out.println(e.getMessage()); |
| 742 | } | 768 | } |
| 743 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | 769 | |
| 744 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 745 | } else if (".ldr".equals(suffix)) { | 770 | } else if (".ldr".equals(suffix)) { |
| 746 | byte[] fileBytes = null; | 771 | byte[] fileBytes = null; |
| 747 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 772 | try { |
| 773 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 748 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 774 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 749 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 775 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 750 | int bytesRead; | 776 | int bytesRead; |
| ... | @@ -753,11 +779,12 @@ public class CourseController extends BaseController { | ... | @@ -753,11 +779,12 @@ public class CourseController extends BaseController { |
| 753 | } | 779 | } |
| 754 | byteArrayOutputStream.flush(); | 780 | byteArrayOutputStream.flush(); |
| 755 | fileBytes = byteArrayOutputStream.toByteArray(); | 781 | fileBytes = byteArrayOutputStream.toByteArray(); |
| 782 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | ||
| 783 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 756 | } catch (IOException e) { | 784 | } catch (IOException e) { |
| 757 | System.out.println(e.getMessage()); | 785 | System.out.println(e.getMessage()); |
| 758 | } | 786 | } |
| 759 | byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); | 787 | |
| 760 | uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); | ||
| 761 | } | 788 | } |
| 762 | if (Objects.nonNull(uploadResult)) { | 789 | if (Objects.nonNull(uploadResult)) { |
| 763 | // 保存文件信息 | 790 | // 保存文件信息 | ... | ... |
-
Please register or sign in to post a comment