no message
Showing
1 changed file
with
14 additions
and
7 deletions
| ... | @@ -107,7 +107,8 @@ public class CourseController extends BaseController { | ... | @@ -107,7 +107,8 @@ public class CourseController extends BaseController { |
| 107 | UploadResult uploadResult = null; | 107 | UploadResult uploadResult = null; |
| 108 | if (".pdf".equals(suffix)) { | 108 | if (".pdf".equals(suffix)) { |
| 109 | byte[] fileBytes = null; | 109 | byte[] fileBytes = null; |
| 110 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 110 | try { |
| 111 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 111 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 112 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 112 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 113 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 113 | int bytesRead; | 114 | int bytesRead; |
| ... | @@ -204,7 +205,8 @@ public class CourseController extends BaseController { | ... | @@ -204,7 +205,8 @@ public class CourseController extends BaseController { |
| 204 | UploadResult uploadResult = null; | 205 | UploadResult uploadResult = null; |
| 205 | if (".pdf".equals(suffix)) { | 206 | if (".pdf".equals(suffix)) { |
| 206 | byte[] fileBytes = null; | 207 | byte[] fileBytes = null; |
| 207 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 208 | try { |
| 209 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 208 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 210 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 209 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 211 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 210 | int bytesRead; | 212 | int bytesRead; |
| ... | @@ -301,7 +303,8 @@ public class CourseController extends BaseController { | ... | @@ -301,7 +303,8 @@ public class CourseController extends BaseController { |
| 301 | UploadResult uploadResult = null; | 303 | UploadResult uploadResult = null; |
| 302 | if (".pdf".equals(suffix)) { | 304 | if (".pdf".equals(suffix)) { |
| 303 | byte[] fileBytes = null; | 305 | byte[] fileBytes = null; |
| 304 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 306 | try { |
| 307 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 305 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 308 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 306 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 309 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 307 | int bytesRead; | 310 | int bytesRead; |
| ... | @@ -398,7 +401,8 @@ public class CourseController extends BaseController { | ... | @@ -398,7 +401,8 @@ public class CourseController extends BaseController { |
| 398 | UploadResult uploadResult = null; | 401 | UploadResult uploadResult = null; |
| 399 | if (".pdf".equals(suffix)) { | 402 | if (".pdf".equals(suffix)) { |
| 400 | byte[] fileBytes = null; | 403 | byte[] fileBytes = null; |
| 401 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 404 | try { |
| 405 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 402 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 406 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 403 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 407 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 404 | int bytesRead; | 408 | int bytesRead; |
| ... | @@ -495,7 +499,8 @@ public class CourseController extends BaseController { | ... | @@ -495,7 +499,8 @@ public class CourseController extends BaseController { |
| 495 | UploadResult uploadResult = null; | 499 | UploadResult uploadResult = null; |
| 496 | if (".pdf".equals(suffix)) { | 500 | if (".pdf".equals(suffix)) { |
| 497 | byte[] fileBytes = null; | 501 | byte[] fileBytes = null; |
| 498 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 502 | try { |
| 503 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 499 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 504 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 500 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 505 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 501 | int bytesRead; | 506 | int bytesRead; |
| ... | @@ -592,7 +597,8 @@ public class CourseController extends BaseController { | ... | @@ -592,7 +597,8 @@ public class CourseController extends BaseController { |
| 592 | UploadResult uploadResult = null; | 597 | UploadResult uploadResult = null; |
| 593 | if (".pdf".equals(suffix)) { | 598 | if (".pdf".equals(suffix)) { |
| 594 | byte[] fileBytes = null; | 599 | byte[] fileBytes = null; |
| 595 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 600 | try { |
| 601 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 596 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 602 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 597 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 603 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 598 | int bytesRead; | 604 | int bytesRead; |
| ... | @@ -689,7 +695,8 @@ public class CourseController extends BaseController { | ... | @@ -689,7 +695,8 @@ public class CourseController extends BaseController { |
| 689 | UploadResult uploadResult = null; | 695 | UploadResult uploadResult = null; |
| 690 | if (".pdf".equals(suffix)) { | 696 | if (".pdf".equals(suffix)) { |
| 691 | byte[] fileBytes = null; | 697 | byte[] fileBytes = null; |
| 692 | try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { | 698 | try { |
| 699 | InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); | ||
| 693 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | 700 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 694 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 | 701 | byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 |
| 695 | int bytesRead; | 702 | int bytesRead; | ... | ... |
-
Please register or sign in to post a comment