Skip to content

Commit ec8bf08

Browse files
atptroJacksonTian
authored andcommitted
patch: add setUsingInternalLocationService method (aliyun#120)
* patch: add setUsingInternalLocationService method
1 parent 53eaec7 commit ec8bf08

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

aliyun-java-sdk-core/src/main/java/com/aliyuncs/profile/DefaultProfile.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,13 @@ public boolean isUsingVpcEndpoint() {
167167
public void enableUsingVpcEndpoint() {
168168
this.usingVpcEndpoint = true;
169169
}
170+
171+
/**
172+
* @deprecated : use enableUsingInternalLocationService instead of this.
173+
*/
174+
@Override
175+
@Deprecated
176+
public void setUsingInternalLocationService() {
177+
enableUsingInternalLocationService();
178+
}
170179
}

aliyun-java-sdk-core/src/main/java/com/aliyuncs/profile/IClientProfile.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ public interface IClientProfile {
5454
public boolean isUsingVpcEndpoint();
5555

5656
public void enableUsingVpcEndpoint();
57+
@Deprecated
58+
public void setUsingInternalLocationService();
5759
}

aliyun-java-sdk-core/src/test/java/com/aliyuncs/profile/DefaultProfileTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,11 @@ public void testProfileConstructor() {
7373
assertEquals("stsToken", profile.getCredential().getSecurityToken());
7474
}
7575

76+
@Test
77+
public void deprecatedTest(){
78+
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou");
79+
profile.setUsingInternalLocationService();
80+
assertTrue(profile.isUsingInternalLocationService());
81+
}
82+
7683
}

0 commit comments

Comments
 (0)