Java Code Examples for org.jeecg.common.util.oss.OssBootUtil#upload()
The following examples show how to use
org.jeecg.common.util.oss.OssBootUtil#upload() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysBaseApiImpl.java From jeecg-cloud with Apache License 2.0 | 5 votes |
@Override public String upload(MultipartFile file,String bizPath,String uploadType) { String url = ""; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ url = MinioUtil.upload(file,bizPath); }else{ url = OssBootUtil.upload(file,bizPath); } return url; }
Example 2
Source File: SysBaseApiImpl.java From jeecg-cloud with Apache License 2.0 | 5 votes |
@Override public String upload(MultipartFile file, String bizPath, String uploadType, String customBucket) { String url = ""; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ url = MinioUtil.upload(file,bizPath,customBucket); }else{ url = OssBootUtil.upload(file,bizPath,customBucket); } return url; }
Example 3
Source File: OSSFileServiceImpl.java From jeecg-cloud with Apache License 2.0 | 5 votes |
@Override public void upload(MultipartFile multipartFile) throws IOException { String fileName = multipartFile.getOriginalFilename(); fileName = CommonUtils.getFileName(fileName); OSSFile ossFile = new OSSFile(); ossFile.setFileName(fileName); String url = OssBootUtil.upload(multipartFile,"upload/test"); ossFile.setUrl(url); this.save(ossFile); }
Example 4
Source File: CommonUtils.java From jeecg-cloud with Apache License 2.0 | 5 votes |
public static String uploadOnlineImage(byte[] data,String basePath,String bizPath,String uploadType){ String dbPath = null; String fileName = "image" + Math.round(Math.random() * 100000000000L); fileName += "." + PoiPublicUtil.getFileExtendName(data); try { if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){ File file = new File(basePath + File.separator + bizPath + File.separator ); if (!file.exists()) { file.mkdirs();// 创建文件根目录 } String savePath = file.getPath() + File.separator + fileName; File savefile = new File(savePath); FileCopyUtils.copy(data, savefile); dbPath = bizPath + File.separator + fileName; }else { InputStream in = new ByteArrayInputStream(data); String relativePath = bizPath+"/"+fileName; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ dbPath = MinioUtil.upload(in,relativePath); }else if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){ dbPath = OssBootUtil.upload(in,relativePath); } } } catch (Exception e) { e.printStackTrace(); } return dbPath; }
Example 5
Source File: CommonUtils.java From jeecg-cloud with Apache License 2.0 | 5 votes |
/** * 统一全局上传 * @Return: java.lang.String */ public static String upload(MultipartFile file, String bizPath, String uploadType) { String url = ""; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ url = MinioUtil.upload(file,bizPath); }else{ url = OssBootUtil.upload(file,bizPath); } return url; }
Example 6
Source File: SysBaseApiImpl.java From teaching with Apache License 2.0 | 5 votes |
@Override public String upload(MultipartFile file,String bizPath,String uploadType) { String url = ""; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ url = MinioUtil.upload(file,bizPath); }else{ url = OssBootUtil.upload(file,bizPath); } return url; }
Example 7
Source File: OSSFileServiceImpl.java From teaching with Apache License 2.0 | 5 votes |
@Override public void upload(MultipartFile multipartFile) throws IOException { String fileName = multipartFile.getOriginalFilename(); OSSFile ossFile = new OSSFile(); ossFile.setFileName(fileName); String url = OssBootUtil.upload(multipartFile,"upload/test"); ossFile.setUrl(url); this.save(ossFile); }
Example 8
Source File: CommonUtils.java From jeecg-boot with Apache License 2.0 | 5 votes |
public static String uploadOnlineImage(byte[] data,String basePath,String bizPath,String uploadType){ String dbPath = null; String fileName = "image" + Math.round(Math.random() * 100000000000L); fileName += "." + PoiPublicUtil.getFileExtendName(data); try { if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){ File file = new File(basePath + File.separator + bizPath + File.separator ); if (!file.exists()) { file.mkdirs();// 创建文件根目录 } String savePath = file.getPath() + File.separator + fileName; File savefile = new File(savePath); FileCopyUtils.copy(data, savefile); dbPath = bizPath + File.separator + fileName; }else { InputStream in = new ByteArrayInputStream(data); String relativePath = bizPath+"/"+fileName; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ dbPath = MinioUtil.upload(in,relativePath); }else if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){ dbPath = OssBootUtil.upload(in,relativePath); } } } catch (Exception e) { e.printStackTrace(); } return dbPath; }
Example 9
Source File: SysBaseApiImpl.java From jeecg-boot with Apache License 2.0 | 5 votes |
@Override public String upload(MultipartFile file,String bizPath,String uploadType) { String url = ""; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ url = MinioUtil.upload(file,bizPath); }else{ url = OssBootUtil.upload(file,bizPath); } return url; }
Example 10
Source File: SysBaseApiImpl.java From jeecg-boot with Apache License 2.0 | 5 votes |
@Override public String upload(MultipartFile file, String bizPath, String uploadType, String customBucket) { String url = ""; if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ url = MinioUtil.upload(file,bizPath,customBucket); }else{ url = OssBootUtil.upload(file,bizPath,customBucket); } return url; }
Example 11
Source File: OSSFileServiceImpl.java From jeecg-boot with Apache License 2.0 | 5 votes |
@Override public void upload(MultipartFile multipartFile) throws IOException { String fileName = multipartFile.getOriginalFilename(); fileName = CommonUtils.getFileName(fileName); OSSFile ossFile = new OSSFile(); ossFile.setFileName(fileName); String url = OssBootUtil.upload(multipartFile,"upload/test"); ossFile.setUrl(url); this.save(ossFile); }