91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

多渠道的oss文件上傳代碼,支持阿里云,騰訊云,七牛多渠道,

資源截圖

代碼片段和文件信息

/*
?*
?*??*??Copyright?(C)?2018??Wanghaobin<463540703@qq.com>
?*
?*??*??AG-Enterprise?企業版源碼
?*??*??鄭重聲明:
?*??*??如果你從其他途徑獲取到,請告知老A傳播人,獎勵1000。
?*??*??老A將追究授予人和傳播人的法律責任!
?*
?*??*??This?program?is?free?software;?you?can?redistribute?it?and/or?modify
?*??*??it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
?*??*??the?Free?Software?Foundation;?either?version?2?of?the?License?or
?*??*??(at?your?option)?any?later?version.
?*
?*??*??This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*??*??but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*??*??MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*??*??GNU?General?Public?License?for?more?details.
?*
?*??*??You?should?have?received?a?copy?of?the?GNU?General?Public?License?along
?*??*??with?this?program;?if?not?write?to?the?Free?Software?Foundation?Inc.
?*??*??51?Franklin?Street?Fifth?Floor?Boston?MA?02110-1301?USA.
?*
?*/

package?com.github.wxiaoqi.oss.cloud;

import?com.aliyun.oss.OSSClient;
import?com.github.wxiaoqi.config.baseException;
import?com.github.wxiaoqi.config.CloudStorageConfig;

import?java.io.ByteArrayInputStream;
import?java.io.InputStream;

/**
?*?阿里云存儲
?*?@author?ace
?*/
public?class?AliyunCloudStorageService?extends?CloudStorageService?{
????private?OSSClient?client;

????public?AliyunCloudStorageService(CloudStorageConfig?config){
????????this.config?=?config;

????????//初始化
????????init();
????}

????private?void?init(){
????????client?=?new?OSSClient(config.getAliyunEndPoint()?config.getAliyunAccessKeyId()
????????????????config.getAliyunAccessKeySecret());
????}

????@Override
????public?String?upload(byte[]?data?String?path)?{
????????return?upload(new?ByteArrayInputStream(data)?path);
????}

????@Override
????public?String?upload(InputStream?inputStream?String?path)?{
????????try?{
????????????client.putobject(config.getAliyunBucketName()?path?inputStream);
????????}?catch?(Exception?e){
????????????throw?new?baseException(“上傳文件失敗,請檢查配置信息“);
????????}

????????return?config.getAliyunDomain()?+?“/“?+?path;
????}

????@Override
????public?String?uploadSuffix(byte[]?data?String?suffix)?{
????????return?upload(data?getPath(config.getAliyunPrefix()?suffix));
????}

????@Override
????public?String?uploadSuffix(InputStream?inputStream?String?suffix)?{
????????return?upload(inputStream?getPath(config.getAliyunPrefix()?suffix));
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-23?16:45??Oss\
?????目錄???????????0??2018-08-23?16:45??Oss\oss\
?????目錄???????????0??2018-08-23?16:45??Oss\oss\cloud\
?????文件????????2630??2018-08-20?17:00??Oss\oss\cloud\AliyunCloudStorageService.java
?????文件????????2983??2018-08-20?17:00??Oss\oss\cloud\CloudStorageService.java
?????文件????????1947??2018-08-20?17:00??Oss\oss\cloud\OSSFactory.java
?????文件????????3599??2018-08-20?17:00??Oss\oss\cloud\QcloudCloudStorageService.java
?????文件????????3207??2018-08-20?17:00??Oss\oss\cloud\QiniuCloudStorageService.java
?????目錄???????????0??2018-08-23?16:45??Oss\oss\config\
?????文件?????????930??2018-08-23?16:15??Oss\oss\config\baseException.java
?????文件?????????647??2018-08-23?16:15??Oss\oss\config\baseResponse.java
?????文件????????6502??2018-08-23?16:15??Oss\oss\config\CloudStorageConfig.java
?????文件?????????661??2018-08-23?16:15??Oss\oss\config\objectRestResponse.java
?????目錄???????????0??2018-08-23?16:45??Oss\oss\constants\
?????文件????????1388??2018-08-20?17:00??Oss\oss\constants\OSSConstant.java
?????目錄???????????0??2018-08-23?16:45??Oss\oss\controller\
?????文件????????2249??2018-08-23?16:15??Oss\oss\controller\OssController.java

評論

共有 條評論