diff --git a/pom.xml b/pom.xml
index f64f4e6cd..379791867 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,8 @@
spring-cloud-alibaba-dependenciesspring-cloud-alibaba-sentinel-autoconfigurespring-cloud-starter-sentinel
+ spring-cloud-alibaba-storage-autoconfigure
+ spring-cloud-starter-storagespring-cloud-alibaba-examples
diff --git a/spring-cloud-alibaba-dependencies/pom.xml b/spring-cloud-alibaba-dependencies/pom.xml
index 0b45f8065..e7bcdbfdc 100644
--- a/spring-cloud-alibaba-dependencies/pom.xml
+++ b/spring-cloud-alibaba-dependencies/pom.xml
@@ -17,6 +17,7 @@
0.1.1
+ 3.1.0
@@ -66,6 +67,11 @@
sentinel-dubbo-adapter${sentinel.version}
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ ${oss.version}
+
@@ -74,6 +80,11 @@
spring-cloud-alibaba-sentinel-autoconfigure${project.version}
+
+ org.springframework.cloud
+ spring-cloud-alibaba-storage-autoconfigure
+ ${project.version}
+
@@ -81,6 +92,11 @@
spring-cloud-starter-sentinel${project.version}
+
+ org.springframework.cloud
+ spring-cloud-starter-storage
+ ${project.version}
+
diff --git a/spring-cloud-alibaba-storage-autoconfigure/pom.xml b/spring-cloud-alibaba-storage-autoconfigure/pom.xml
new file mode 100644
index 000000000..b40e4286d
--- /dev/null
+++ b/spring-cloud-alibaba-storage-autoconfigure/pom.xml
@@ -0,0 +1,60 @@
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-alibaba
+ 0.2.0.BUILD-SNAPSHOT
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-alibaba-storage-autoconfigure
+ Spring Cloud Alibaba Storage Autoconfigure
+
+
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ true
+
+
+
+ org.springframework.boot
+ spring-boot-actuator
+ provided
+ true
+
+
+
+ org.springframework.boot
+ spring-boot-actuator-autoconfigure
+ provided
+ true
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ provided
+ true
+
+
+
+ org.slf4j
+ slf4j-api
+ provided
+ true
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
diff --git a/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSApplicationListener.java b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSApplicationListener.java
new file mode 100644
index 000000000..e5e56de7d
--- /dev/null
+++ b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSApplicationListener.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.alibaba.storage;
+
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.event.ContextClosedEvent;
+
+import com.aliyun.oss.OSS;
+
+/**
+ * Shutdown All OSS Clients when {@code ApplicationContext} gets closed {@link ApplicationListener}
+ *
+ * @author Jim
+ */
+public class OSSApplicationListener implements ApplicationListener {
+
+ private static final Logger logger = LoggerFactory
+ .getLogger(OSSApplicationListener.class);
+
+ @Override
+ public void onApplicationEvent(ContextClosedEvent event) {
+ Map ossClientMap = event.getApplicationContext()
+ .getBeansOfType(OSS.class);
+ logger.info("{} OSSClients will be shutdown soon", ossClientMap.size());
+ ossClientMap.keySet().forEach(beanName -> {
+ logger.info("shutdown ossClient: {}", beanName);
+ ossClientMap.get(beanName).shutdown();
+ });
+ }
+}
diff --git a/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSAutoConfiguration.java b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSAutoConfiguration.java
new file mode 100644
index 000000000..9ab78b03f
--- /dev/null
+++ b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSAutoConfiguration.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.alibaba.storage;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.alibaba.storage.resource.OSSStorageProtocolResolver;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+
+/**
+ * OSS Auto {@link Configuration}
+ *
+ * @author Jim
+ */
+@Configuration
+@ConditionalOnClass(OSS.class)
+@ConditionalOnProperty(name = OSSConstants.ENABLED, havingValue = "true", matchIfMissing = true)
+@EnableConfigurationProperties(OSSProperties.class)
+public class OSSAutoConfiguration {
+
+ private static final Logger logger = LoggerFactory
+ .getLogger(OSSAutoConfiguration.class);
+
+ @ConditionalOnMissingBean
+ @Bean
+ public OSS ossClient(OSSProperties ossProperties) {
+ logger.info("construct OSS because it is missing");
+ return new OSSClientBuilder().build(ossProperties.getEndpoint(),
+ ossProperties.getAccessKeyId(), ossProperties.getSecretAccessKey(),
+ ossProperties.getSecurityToken(), ossProperties.getConfiguration());
+ }
+
+ @ConditionalOnMissingBean
+ @Bean
+ public OSSStorageProtocolResolver ossStorageProtocolResolver() {
+ return new OSSStorageProtocolResolver();
+ }
+
+}
diff --git a/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSConstants.java b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSConstants.java
new file mode 100644
index 000000000..7bf76938d
--- /dev/null
+++ b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSConstants.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.alibaba.storage;
+
+/**
+ * OSS constants
+ *
+ * @author Jim
+ */
+public interface OSSConstants {
+
+ String PREFIX = "spring.cloud.alibaba.oss";
+ String ENABLED = PREFIX + ".enabled";
+
+}
diff --git a/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSProperties.java b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSProperties.java
new file mode 100644
index 000000000..cd39077ef
--- /dev/null
+++ b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/OSSProperties.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.alibaba.storage;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+import com.aliyun.oss.ClientBuilderConfiguration;
+
+/**
+ * {@link ConfigurationProperties} for configuring OSS.
+ *
+ * @author Jim
+ */
+@ConfigurationProperties(prefix = OSSConstants.PREFIX)
+public class OSSProperties {
+
+ private static final Logger logger = LoggerFactory.getLogger(OSSProperties.class);
+
+ public static final Map endpointMap = new HashMap<>();
+
+ static {
+ endpointMap.put("cn-beijing", "http://oss-cn-beijing.aliyuncs.com");
+ endpointMap.put("cn-qingdao", "http://oss-cn-qingdao.aliyuncs.com");
+ endpointMap.put("cn-hangzhou", "http://oss-cn-hangzhou.aliyuncs.com");
+ endpointMap.put("cn-hongkong", "http://oss-cn-hongkong.aliyuncs.com");
+ endpointMap.put("cn-shenzhen", "http://oss-cn-shenzhen.aliyuncs.com");
+ endpointMap.put("us-west-1", "http://oss-us-west-1.aliyuncs.com");
+ endpointMap.put("ap-southeast-1", "http://oss-ap-southeast-1.aliyuncs.com");
+ }
+
+ private ClientBuilderConfiguration configuration;
+
+ private String accessKeyId;
+
+ private String secretAccessKey;
+
+ private String region;
+
+ private String endpoint;
+
+ // support ram sts
+ private String securityToken;
+
+ public ClientBuilderConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(ClientBuilderConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public String getAccessKeyId() {
+ return accessKeyId;
+ }
+
+ public void setAccessKeyId(String accessKeyId) {
+ this.accessKeyId = accessKeyId;
+ }
+
+ public String getSecretAccessKey() {
+ return secretAccessKey;
+ }
+
+ public void setSecretAccessKey(String secretAccessKey) {
+ this.secretAccessKey = secretAccessKey;
+ }
+
+ public String getEndpoint() {
+ return endpoint;
+ }
+
+ public void setEndpoint(String endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public String getSecurityToken() {
+ return securityToken;
+ }
+
+ public void setSecurityToken(String securityToken) {
+ this.securityToken = securityToken;
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ public void setRegion(String region) {
+ if (!endpointMap.containsKey(region)) {
+ String errorStr = "error region: " + region + ", please choose from "
+ + Arrays.toString(endpointMap.keySet().toArray());
+ logger.error(errorStr);
+ throw new IllegalArgumentException(errorStr);
+ }
+ this.region = region;
+ this.setEndpoint(endpointMap.get(region));
+ }
+}
diff --git a/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/endpoint/OSSEndpoint.java b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/endpoint/OSSEndpoint.java
new file mode 100644
index 000000000..02a89b588
--- /dev/null
+++ b/spring-cloud-alibaba-storage-autoconfigure/src/main/java/org/springframework/cloud/alibaba/storage/endpoint/OSSEndpoint.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.alibaba.storage.endpoint;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
+import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
+import org.springframework.context.ApplicationContext;
+
+import com.aliyun.oss.OSSClient;
+
+/**
+ * Actuator {@link Endpoint} to expose OSS Meta Data
+ *
+ * @author Jim
+ */
+@Endpoint(id = "oss")
+public class OSSEndpoint {
+
+ @Autowired
+ private ApplicationContext applicationContext;
+
+ @ReadOperation
+ public Map invoke() {
+ Map result = new HashMap<>();
+
+ Map ossClientMap = applicationContext
+ .getBeansOfType(OSSClient.class);
+
+ int size = ossClientMap.size();
+
+ List