Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
miria-project-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张征龙
miria-project-test
Commits
3036f297
Commit
3036f297
authored
Apr 08, 2018
by
张征龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
精简jar
parent
33d545b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
23 deletions
+39
-23
build.gradle
build.gradle
+0
-9
Application.java
...ain/java/cn/com/duiba/miria/project/test/Application.java
+0
-6
CSVCreate.java
...java/cn/com/duiba/miria/project/test/utils/CSVCreate.java
+39
-8
No files found.
build.gradle
View file @
3036f297
...
...
@@ -71,20 +71,11 @@ dependencyManagement {
}
dependencies
{
compile
'cn.com.duiba.boot:spring-boot-starter-perftest'
compile
'cn.com.duiba.boot:spring-boot-starter-cat'
compile
'cn.com.duiba.boot:spring-boot-starter-xss'
compile
'org.springframework.boot:spring-boot-starter-web'
compile
'org.springframework.boot:spring-boot-starter-actuator'
compile
'org.springframework.boot:spring-boot-starter-freemarker'
compile
'org.springframework.cloud:spring-cloud-starter-config'
compile
'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
compile
'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'
compile
'org.springframework.cloud:spring-cloud-starter-netflix-ribbon'
compile
'org.springframework.cloud:spring-cloud-starter-openfeign'
compile
'javax.validation:validation-api:1.1.0.Final'
compile
'io.springfox:springfox-swagger-ui:2.5.0'
compile
'io.springfox:springfox-swagger2:2.5.0'
...
...
src/main/java/cn/com/duiba/miria/project/test/Application.java
View file @
3036f297
...
...
@@ -2,14 +2,8 @@ package cn.com.duiba.miria.project.test;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.netflix.feign.EnableDuibaFeignClients
;
@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableDuibaFeignClients
(
basePackages
=
{
"cn.com.duiba"
})
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/cn/com/duiba/miria/project/test/utils/CSVCreate.java
View file @
3036f297
...
...
@@ -6,11 +6,8 @@ import org.slf4j.Logger;
import
sun.applet.Main
;
import
javax.servlet.ServletOutputStream
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStreamWriter
;
import
java.io.*
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.nio.charset.Charset
;
import
java.util.ArrayList
;
...
...
@@ -109,12 +106,46 @@ public class CSVCreate {
List
<
String
>
s
=
new
ArrayList
<
String
>();
s
.
add
(
"测试"
);
s
.
add
(
"差别"
);
for
(
int
i
=
0
;
i
<
10
;
i
++){
charSink
.
writeLines
(
s
);
}
charSink
.
writeLines
(
s
);
System
.
out
.
println
(
"end"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
static
String
getEncoding
(
String
str
)
{
String
encode
=
"GB2312"
;
try
{
if
(
str
.
equals
(
new
String
(
str
.
getBytes
(
encode
),
encode
)))
{
// 判断是不是GB2312
String
s
=
encode
;
return
s
;
// 是的话,返回“GB2312“,以下代码同理
}
}
catch
(
Exception
exception
)
{
}
encode
=
"ISO-8859-1"
;
try
{
if
(
str
.
equals
(
new
String
(
str
.
getBytes
(
encode
),
encode
)))
{
// 判断是不是ISO-8859-1
String
s1
=
encode
;
return
s1
;
}
}
catch
(
Exception
exception1
)
{
}
encode
=
"UTF-8"
;
try
{
if
(
str
.
equals
(
new
String
(
str
.
getBytes
(
encode
),
encode
)))
{
// 判断是不是UTF-8
String
s2
=
encode
;
return
s2
;
}
}
catch
(
Exception
exception2
)
{
}
encode
=
"GBK"
;
try
{
if
(
str
.
equals
(
new
String
(
str
.
getBytes
(
encode
),
encode
)))
{
// 判断是不是GBK
String
s3
=
encode
;
return
s3
;
}
}
catch
(
Exception
exception3
)
{
}
return
"no charSet matched"
;
// 如果都不是,说明输入的内容不属于常见的编码格式。
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment