Skip to content

Commit fa10b70

Browse files
authored
Merge pull request #228 from longbai/dns_host_first
Dns host first
2 parents cd7fb6a + 8b3f924 commit fa10b70

25 files changed

+686
-684
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#Changelog
22

3+
## 7.1.3 (2016-09-02)
4+
### 增加
5+
* 下载方法
6+
* 支持x:foo变量
7+
* batch 增加force
8+
* host first
9+
310
## 7.1.2 (2016-07-14)
411
### 增加
512
* 内部dns 解析支持

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'java'
55
sourceCompatibility = 1.7
66
targetCompatibility = 1.7
77
version = '1.0'
8-
[compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
8+
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
99

1010
repositories {
1111
mavenCentral()
@@ -18,10 +18,10 @@ dependencies {
1818
// if (c < 0) {
1919
// compile fileTree(dir: 'libs', include: '*.jar')
2020
// } else {
21-
compile group:'com.squareup.okhttp3', name:'okhttp', version:'3.3.1'
21+
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.3.1'
2222
// }
23-
compile group:'com.google.code.gson', name:'gson', version:'2.6.2'
24-
compile group:'com.qiniu', name:'happy-dns-java', version:'0.1.4'
23+
compile group: 'com.google.code.gson', name: 'gson', version: '2.6.2'
24+
compile group: 'com.qiniu', name: 'happy-dns-java', version: '0.1.4'
2525
testCompile group: 'junit', name: 'junit', version: '4.12'
2626
}
2727

@@ -57,8 +57,8 @@ apply from: 'mvn_push.gradle'
5757

5858
apply plugin: 'eclipse'
5959

60-
task gen_eclipse(dependsOn:[
61-
'cleanEclipseProject', 'cleanEclipseClasspath',
62-
'eclipseProject', 'eclipseClasspath'])
60+
task gen_eclipse(dependsOn: [
61+
'cleanEclipseProject', 'cleanEclipseClasspath',
62+
'eclipseProject', 'eclipseClasspath'])
6363
eclipseProject.mustRunAfter cleanEclipseProject
6464
eclipseClasspath.mustRunAfter cleanEclipseClasspath

config/checkstyle/checkstyle.xml

Lines changed: 125 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
3+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
55

66
<module name="Checker">
7-
<module name="NewlineAtEndOfFile"/>
8-
<module name="FileLength"/>
9-
<module name="FileTabCharacter"/>
10-
11-
<!-- Trailing spaces -->
12-
<module name="RegexpSingleline">
13-
<property name="format" value="\s+$"/>
14-
<property name="message" value="Line has trailing spaces."/>
15-
</module>
16-
17-
<!-- Space after 'for' and 'if' -->
18-
<module name="RegexpSingleline">
19-
<property name="format" value="^\s*(for|if)\b[^ ]"/>
20-
<property name="message" value="Space needed before opening parenthesis."/>
21-
</module>
22-
23-
<!-- For each spacing -->
24-
<module name="RegexpSingleline">
25-
<property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
26-
<property name="message" value="Space needed around ':' character."/>
27-
</module>
28-
29-
<module name="SuppressionCommentFilter">
30-
</module>
31-
32-
<module name="TreeWalker">
33-
<module name="FileContentsHolder"/>
34-
<!-- Checks for Javadoc comments. -->
35-
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
36-
<!--module name="JavadocMethod"/-->
37-
<!--module name="JavadocType"/-->
38-
<!--module name="JavadocVariable"/-->
39-
<module name="JavadocStyle">
40-
<property name="checkFirstSentence" value="false"/>
7+
<module name="NewlineAtEndOfFile"/>
8+
<module name="FileLength"/>
9+
<module name="FileTabCharacter"/>
10+
11+
<!-- Trailing spaces -->
12+
<module name="RegexpSingleline">
13+
<property name="format" value="\s+$"/>
14+
<property name="message" value="Line has trailing spaces."/>
4115
</module>
4216

17+
<!-- Space after 'for' and 'if' -->
18+
<module name="RegexpSingleline">
19+
<property name="format" value="^\s*(for|if)\b[^ ]"/>
20+
<property name="message" value="Space needed before opening parenthesis."/>
21+
</module>
22+
23+
<!-- For each spacing -->
24+
<module name="RegexpSingleline">
25+
<property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
26+
<property name="message" value="Space needed around ':' character."/>
27+
</module>
4328

44-
<!-- Checks for Naming Conventions. -->
45-
<!-- See http://checkstyle.sf.net/config_naming.html -->
46-
<!--<module name="ConstantName"/>
47-
<module name="LocalFinalVariableName"/>
48-
<module name="LocalVariableName"/>-->
49-
<module name="MemberName"/>
50-
<module name="MethodName"/>
51-
<module name="PackageName"/>
52-
<!--<module name="ParameterName"/>-->
53-
<module name="StaticVariableName"/>
54-
<module name="TypeName"/>
55-
56-
57-
<!-- Checks for imports -->
58-
<!-- See http://checkstyle.sf.net/config_import.html -->
59-
<!--<module name="AvoidStarImport"/> -->
60-
<module name="IllegalImport"/>
61-
<!-- defaults to sun.* packages -->
62-
<module name="RedundantImport"/>
63-
<module name="UnusedImports">
64-
<property name="processJavadoc" value="true"/>
29+
<module name="SuppressionCommentFilter">
6530
</module>
6631

67-
<!-- Checks for Size Violations. -->
68-
<!-- See http://checkstyle.sf.net/config_sizes.html -->
69-
<module name="LineLength">
70-
<property name="max" value="120"/>
32+
<module name="TreeWalker">
33+
<module name="FileContentsHolder"/>
34+
<!-- Checks for Javadoc comments. -->
35+
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
36+
<!--module name="JavadocMethod"/-->
37+
<!--module name="JavadocType"/-->
38+
<!--module name="JavadocVariable"/-->
39+
<module name="JavadocStyle">
40+
<property name="checkFirstSentence" value="false"/>
41+
</module>
42+
43+
44+
<!-- Checks for Naming Conventions. -->
45+
<!-- See http://checkstyle.sf.net/config_naming.html -->
46+
<!--<module name="ConstantName"/>
47+
<module name="LocalFinalVariableName"/>
48+
<module name="LocalVariableName"/>-->
49+
<module name="MemberName"/>
50+
<module name="MethodName"/>
51+
<module name="PackageName"/>
52+
<!--<module name="ParameterName"/>-->
53+
<module name="StaticVariableName"/>
54+
<module name="TypeName"/>
55+
56+
57+
<!-- Checks for imports -->
58+
<!-- See http://checkstyle.sf.net/config_import.html -->
59+
<!--<module name="AvoidStarImport"/> -->
60+
<module name="IllegalImport"/>
61+
<!-- defaults to sun.* packages -->
62+
<module name="RedundantImport"/>
63+
<module name="UnusedImports">
64+
<property name="processJavadoc" value="true"/>
65+
</module>
66+
67+
<!-- Checks for Size Violations. -->
68+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
69+
<module name="LineLength">
70+
<property name="max" value="120"/>
71+
</module>
72+
<module name="MethodLength"/>
73+
74+
75+
<!-- Checks for whitespace -->
76+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
77+
<module name="GenericWhitespace"/>
78+
<!--<module name="EmptyForIteratorPad"/>-->
79+
<module name="MethodParamPad"/>
80+
<!--<module name="NoWhitespaceAfter"/>-->
81+
<!--<module name="NoWhitespaceBefore"/>-->
82+
<module name="OperatorWrap"/>
83+
<module name="ParenPad"/>
84+
<module name="TypecastParenPad"/>
85+
<module name="WhitespaceAfter"/>
86+
<module name="WhitespaceAround"/>
87+
88+
89+
<!-- Modifier Checks -->
90+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
91+
<module name="ModifierOrder"/>
92+
<module name="RedundantModifier"/>
93+
94+
95+
<!-- Checks for blocks. You know, those {}'s -->
96+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
97+
<module name="AvoidNestedBlocks"/>
98+
<!--module name="EmptyBlock"/-->
99+
<module name="LeftCurly"/>
100+
<!--<module name="NeedBraces"/>-->
101+
<module name="RightCurly"/>
102+
103+
104+
<!-- Checks for common coding problems -->
105+
<!-- See http://checkstyle.sf.net/config_coding.html -->
106+
<!--module name="AvoidInlineConditionals"/-->
107+
<module name="CovariantEquals"/>
108+
<module name="EmptyStatement"/>
109+
<!--<module name="EqualsAvoidNull"/>-->
110+
<module name="EqualsHashCode"/>
111+
<!--module name="HiddenField"/-->
112+
<module name="IllegalInstantiation"/>
113+
<!--module name="InnerAssignment"/-->
114+
<!--module name="MagicNumber"/-->
115+
<!--module name="MissingSwitchDefault"/-->
116+
<module name="RedundantThrows"/>
117+
<module name="SimplifyBooleanExpression"/>
118+
<module name="SimplifyBooleanReturn"/>
119+
120+
<!-- Checks for class design -->
121+
<!-- See http://checkstyle.sf.net/config_design.html -->
122+
<!--module name="DesignForExtension"/-->
123+
<!--<module name="FinalClass"/>-->
124+
<module name="HideUtilityClassConstructor"/>
125+
<module name="InterfaceIsType"/>
126+
<!--module name="VisibilityModifier"/-->
127+
128+
129+
<!-- Miscellaneous other checks. -->
130+
<!-- See http://checkstyle.sf.net/config_misc.html -->
131+
<module name="ArrayTypeStyle"/>
132+
<!--module name="FinalParameters"/-->
133+
<!--module name="TodoComment"/-->
134+
<module name="UpperEll"/>
71135
</module>
72-
<module name="MethodLength"/>
73-
74-
75-
<!-- Checks for whitespace -->
76-
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
77-
<module name="GenericWhitespace"/>
78-
<!--<module name="EmptyForIteratorPad"/>-->
79-
<module name="MethodParamPad"/>
80-
<!--<module name="NoWhitespaceAfter"/>-->
81-
<!--<module name="NoWhitespaceBefore"/>-->
82-
<module name="OperatorWrap"/>
83-
<module name="ParenPad"/>
84-
<module name="TypecastParenPad"/>
85-
<module name="WhitespaceAfter"/>
86-
<module name="WhitespaceAround"/>
87-
88-
89-
<!-- Modifier Checks -->
90-
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
91-
<module name="ModifierOrder"/>
92-
<module name="RedundantModifier"/>
93-
94-
95-
<!-- Checks for blocks. You know, those {}'s -->
96-
<!-- See http://checkstyle.sf.net/config_blocks.html -->
97-
<module name="AvoidNestedBlocks"/>
98-
<!--module name="EmptyBlock"/-->
99-
<module name="LeftCurly"/>
100-
<!--<module name="NeedBraces"/>-->
101-
<module name="RightCurly"/>
102-
103-
104-
<!-- Checks for common coding problems -->
105-
<!-- See http://checkstyle.sf.net/config_coding.html -->
106-
<!--module name="AvoidInlineConditionals"/-->
107-
<module name="CovariantEquals"/>
108-
<module name="EmptyStatement"/>
109-
<!--<module name="EqualsAvoidNull"/>-->
110-
<module name="EqualsHashCode"/>
111-
<!--module name="HiddenField"/-->
112-
<module name="IllegalInstantiation"/>
113-
<!--module name="InnerAssignment"/-->
114-
<!--module name="MagicNumber"/-->
115-
<!--module name="MissingSwitchDefault"/-->
116-
<module name="RedundantThrows"/>
117-
<module name="SimplifyBooleanExpression"/>
118-
<module name="SimplifyBooleanReturn"/>
119-
120-
<!-- Checks for class design -->
121-
<!-- See http://checkstyle.sf.net/config_design.html -->
122-
<!--module name="DesignForExtension"/-->
123-
<!--<module name="FinalClass"/>-->
124-
<module name="HideUtilityClassConstructor"/>
125-
<module name="InterfaceIsType"/>
126-
<!--module name="VisibilityModifier"/-->
127-
128-
129-
<!-- Miscellaneous other checks. -->
130-
<!-- See http://checkstyle.sf.net/config_misc.html -->
131-
<module name="ArrayTypeStyle"/>
132-
<!--module name="FinalParameters"/-->
133-
<!--module name="TodoComment"/-->
134-
<module name="UpperEll"/>
135-
</module>
136136
</module>

examples/BatchDemo.java

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
11
import com.qiniu.common.QiniuException;
22
import com.qiniu.http.Response;
33
import com.qiniu.storage.BucketManager;
4-
import com.qiniu.storage.model.FileInfo;
5-
import com.qiniu.storage.model.FileListing;
64
import com.qiniu.util.Auth;
75

86

97
public class BatchDemo {
10-
public static void main(String args[]){
11-
//设置需要操作的账号的AK和SK
12-
String ACCESS_KEY = "Access_Key";
13-
String SECRET_KEY = "Secret_Key";
14-
Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY);
15-
16-
//实例化一个BucketManager对象
17-
BucketManager bucketManager = new BucketManager(auth);
18-
19-
//创建Batch类型的operations对象
20-
BucketManager.Batch operations = new BucketManager.Batch();
21-
22-
//第一组源空间名、原文件名,目的空间名、目的文件名
23-
String bucketFrom1 = "yourbucket";
24-
String keyFrom1 = "srckey1";
25-
String bucketTo1 = "yourbucket";
26-
String keyTo1 = "destkey1";
27-
28-
//第二组源空间名、原文件名,目的空间名、目的文件名
29-
String bucketFrom2 = "yourbucket";
30-
String keyFrom2 = "srckey2";
31-
String bucketTo2 = "yourbucket";
32-
String keyTo2 = "destkey2";
33-
34-
35-
try {
36-
//调用批量操作的batch方法
37-
Response res = bucketManager.batch(operations.move(bucketFrom1, keyFrom1, bucketTo1, keyTo1)
38-
.move(bucketFrom2, keyFrom2, bucketTo2, keyTo2));
39-
40-
System.out.println(res.toString());
41-
42-
} catch (QiniuException e) {
43-
//捕获异常信息
44-
Response r = e.response;
45-
System.out.println(r.toString());
46-
}
47-
}
8+
public static void main(String args[]) {
9+
//设置需要操作的账号的AK和SK
10+
String ACCESS_KEY = "Access_Key";
11+
String SECRET_KEY = "Secret_Key";
12+
Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY);
13+
14+
//实例化一个BucketManager对象
15+
BucketManager bucketManager = new BucketManager(auth);
16+
17+
//创建Batch类型的operations对象
18+
BucketManager.Batch operations = new BucketManager.Batch();
19+
20+
//第一组源空间名、原文件名,目的空间名、目的文件名
21+
String bucketFrom1 = "yourbucket";
22+
String keyFrom1 = "srckey1";
23+
String bucketTo1 = "yourbucket";
24+
String keyTo1 = "destkey1";
25+
26+
//第二组源空间名、原文件名,目的空间名、目的文件名
27+
String bucketFrom2 = "yourbucket";
28+
String keyFrom2 = "srckey2";
29+
String bucketTo2 = "yourbucket";
30+
String keyTo2 = "destkey2";
31+
32+
33+
try {
34+
//调用批量操作的batch方法
35+
Response res = bucketManager.batch(operations.move(bucketFrom1, keyFrom1, bucketTo1, keyTo1)
36+
.move(bucketFrom2, keyFrom2, bucketTo2, keyTo2));
37+
38+
System.out.println(res.toString());
39+
40+
} catch (QiniuException e) {
41+
//捕获异常信息
42+
Response r = e.response;
43+
System.out.println(r.toString());
44+
}
45+
}
4846
}

0 commit comments

Comments
 (0)