File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/main/java/com/aliyun/oss/common/utils Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,16 @@ public static boolean checkFile(File file) {
129129 public static InputStream newRepeatableInputStream (final InputStream original ) throws IOException {
130130 InputStream repeatable = null ;
131131 if (!original .markSupported ()) {
132- if (original instanceof FileInputStream ) {
133- repeatable = new RepeatableFileInputStream ((FileInputStream ) original );
134- } else {
135- repeatable = new BufferedInputStream (original , OSSConstants .DEFAULT_STREAM_BUFFER_SIZE );
132+ try {
133+ if (original instanceof FileInputStream ) {
134+ repeatable = new RepeatableFileInputStream ((FileInputStream ) original );
135+ } else {
136+ repeatable = new BufferedInputStream (original , OSSConstants .DEFAULT_STREAM_BUFFER_SIZE );
137+ }
138+ } catch (Throwable e ) {
139+ if (repeatable == null ) {
140+ repeatable = original ;
141+ }
136142 }
137143 } else {
138144 repeatable = original ;
You can’t perform that action at this time.
0 commit comments