| | |
| | | if (imgFile.contains("?")) { |
| | | fileName = imgFile.substring(0, imgFile.indexOf("?")); |
| | | } |
| | | try { |
| | | |
| | | fileName = URLDecoder.decode(fileName, "UTF-8"); |
| | | } catch (UnsupportedEncodingException ex) { |
| | | // throw new RuntimeException(ex); |
| | | } |
| | | |
| | | // 根据BucketName,objectName删除文件 |
| | | boolean b = ossClient.doesObjectExist(bucketName, fileName); |
| | | if (b) { |
| | | VoidResult voidResult = ossClient.deleteObject(bucketName, fileName); |
| | | System.out.println(voidResult.toString()); |
| | | // System.out.println(voidResult.toString()); |
| | | } |
| | | ossClient.shutdown(); |
| | | return true; |