File tree 3 files changed +21
-27
lines changed
SpringBootDemo/SpringBoot+Angular2
src/main/java/com/grapecity/documents/demo/controller 3 files changed +21
-27
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,10 @@ dependencies {
40
40
// dependencies of GcExcel
41
41
compile(' com.grapecity.documents:gcexcel:2.0.1' )
42
42
}
43
+
44
+ task clientBuild (type : GradleBuild ){
45
+ buildFile = " ./client/build.gradle"
46
+ tasks = [' webpack' ]
47
+ }
48
+
49
+ processResources. dependsOn ' clientBuild'
Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id " com.moowork.node" version " 1.2.0"
3
+ }
4
+
5
+ node {
6
+ version = ' 8.12.0'
7
+ download = false
8
+ }
9
+
10
+ task webpack (type : NodeTask , dependsOn : ' npmInstall' ) {
11
+ script = project. file(' ./node_modules/webpack/bin/webpack.js' )
12
+ args = [' --config' , " ./webpack.config.js" ]
13
+ }
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public String open(HttpServletRequest request) {
58
58
Workbook workbook = new Workbook ();
59
59
60
60
try {
61
- workbook .open (this . convertStream ( request .getInputStream () ));
61
+ workbook .open (request .getInputStream ());
62
62
}
63
63
catch (IOException e ) {
64
64
// TODO Auto-generated catch block
@@ -68,32 +68,6 @@ public String open(HttpServletRequest request) {
68
68
return workbook .toJson ();
69
69
}
70
70
71
- /**
72
- * This is a workaround method for gcexcel v2.0.0.
73
- * HttpServletRequest.getInputStream() returns a stream instance of CoyoteInputStream.
74
- * It causes exception when directly opened by Workbook.
75
- *
76
- * This bug will be fixed in next release.
77
- * @param requestStream
78
- * @return
79
- * @throws IOException
80
- */
81
- private InputStream convertStream (InputStream requestStream ) throws IOException {
82
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
83
-
84
- byte [] buffer = new byte [8 * 1024 ];
85
- int bytesRead ;
86
- while ((bytesRead = requestStream .read (buffer )) != -1 ) {
87
- outputStream .write (buffer , 0 , bytesRead );
88
- }
89
-
90
- outputStream .flush ();
91
- InputStream result = new ByteArrayInputStream (outputStream .toByteArray ());
92
-
93
- outputStream .close ();
94
- return result ;
95
- }
96
-
97
71
@ RequestMapping (value = "/save" )
98
72
public void save (HttpServletRequest request , HttpServletResponse response ) {
99
73
Workbook workbook = new Workbook ();
You can’t perform that action at this time.
0 commit comments