Skip to content

Commit f95e99b

Browse files
committed
fix warnings in license generator
1 parent c9a7c09 commit f95e99b

File tree

8 files changed

+61
-27
lines changed

8 files changed

+61
-27
lines changed

deploy

-5
This file was deleted.

deploy.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
#
3+
# The MIT License
4+
#
5+
# Copyright for portions of unirest-java are held by Kong Inc (c) 2013.
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining
8+
# a copy of this software and associated documentation files (the
9+
# "Software"), to deal in the Software without restriction, including
10+
# without limitation the rights to use, copy, modify, merge, publish,
11+
# distribute, sublicense, and/or sell copies of the Software, and to
12+
# permit persons to whom the Software is furnished to do so, subject to
13+
# the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be
16+
# included in all copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25+
#
26+
27+
28+
mvn clean verify
29+
mvn release:prepare -DskipTests
30+
mvn release:perform -DskipTests

pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@
9595
<header>${main.dir}/build/fileHeader.txt</header>
9696
<strictCheck>true</strictCheck>
9797
<excludes>
98+
<exclude>**/*.scss</exclude>
99+
<exclude>**/*.b64</exclude>
100+
<exclude>**/*.svg</exclude>
101+
<exclude>**/Gemfile</exclude>
102+
<exclude>.java-version</exclude>
103+
<exclude>.java-version</exclude>
98104
<exclude>**/*.js</exclude>
105+
<exclude>**/*.json</exclude>
106+
<exclude>**/*.p12</exclude>
107+
<exclude>**/*.pem</exclude>
99108
<exclude>**/*.html</exclude>
100109
<exclude>**/*.xml</exclude>
101110
<exclude>**/*.txt</exclude>

unirest/src/test/java/BehaviorTests/MultiPartFormPostingTest.java

+19-19
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testMultipart() throws Exception {
4242
Unirest.post(MockServer.POST)
4343
.field("name", "Mark")
4444
.field("funky","bunch")
45-
.field("file", rezFile("/test"))
45+
.field("file", rezFile("/test.txt"))
4646
.asObject(RequestCapture.class)
4747
.getBody()
4848
.assertParam("name", "Mark")
4949
.assertMultiPartContentType()
50-
.getFile("test")
50+
.getFile("test.txt")
5151
.assertBody("This is a test file")
5252
.assertFileType("application/octet-stream");
5353
}
@@ -83,7 +83,7 @@ public void testMultipartContentType() {
8383

8484
@Test
8585
public void canSendRawInputStreamsWithoutAFileName() throws Exception {
86-
FileInputStream stream = new FileInputStream(rezFile("/test"));
86+
FileInputStream stream = new FileInputStream(rezFile("/test.txt"));
8787

8888
Unirest.post(MockServer.POST)
8989
.field("file", stream)
@@ -126,11 +126,11 @@ public void testMultipartInputStreamContentType() throws Exception {
126126
public void testMultipartInputStreamContentTypeAsync() throws Exception {
127127
Unirest.post(MockServer.POST)
128128
.field("name", "Mark")
129-
.field("file", new FileInputStream(rezFile("/test")), ContentType.APPLICATION_OCTET_STREAM, "test")
129+
.field("file", new FileInputStream(rezFile("/test.txt")), ContentType.APPLICATION_OCTET_STREAM, "test.txt")
130130
.asJsonAsync(new MockCallback<>(this, r -> parse(r)
131131
.assertParam("name", "Mark")
132132
.assertMultiPartContentType()
133-
.getFile("test")
133+
.getFile("test.txt")
134134
.assertFileType("application/octet-stream"))
135135
);
136136

@@ -153,16 +153,16 @@ public void testMultipartByteContentType() throws Exception {
153153

154154
@Test
155155
public void testMultipartByteContentTypeAsync() throws Exception {
156-
final byte[] bytes = getFileBytes("/test");
156+
final byte[] bytes = getFileBytes("/test.txt");
157157

158158
Unirest.post(MockServer.POST)
159159
.field("name", "Mark")
160-
.field("file", bytes, "test")
160+
.field("file", bytes, "test.txt")
161161
.asJsonAsync(new MockCallback<>(this, r ->
162162
parse(r)
163163
.assertParam("name", "Mark")
164164
.assertMultiPartContentType()
165-
.getFile("test")
165+
.getFile("test.txt")
166166
.assertFileType("application/octet-stream"))
167167
);
168168

@@ -175,12 +175,12 @@ public void testMultipartByteContentTypeAsync() throws Exception {
175175
public void testMultipartAsync() throws Exception {
176176
Unirest.post(MockServer.POST)
177177
.field("name", "Mark")
178-
.field("file", rezFile("/test"))
178+
.field("file", rezFile("/test.txt"))
179179
.asJsonAsync(new MockCallback<>(this, r ->
180180
parse(r)
181181
.assertParam("name", "Mark")
182182
.assertMultiPartContentType()
183-
.getFile("test")
183+
.getFile("test.txt")
184184
.assertFileType("application/octet-stream")
185185
.assertBody("This is a test file"))
186186
);
@@ -302,21 +302,21 @@ public void multiPartInputStreamAsFile() throws FileNotFoundException {
302302
@Test
303303
public void testPostMulipleFIles() {
304304
RequestCapture cap = Unirest.post(MockServer.POST)
305-
.field("name", asList(rezFile("/test"), rezFile("/test2")))
305+
.field("name", asList(rezFile("/test.txt"), rezFile("/test2.txt")))
306306
.asObject(RequestCapture.class)
307307
.getBody()
308308
.assertMultiPartContentType();
309309

310-
cap.getFile("test").assertBody("This is a test file");
311-
cap.getFile("test2").assertBody("this is another test");
310+
cap.getFile("test.txt").assertBody("This is a test file");
311+
cap.getFile("test2.txt").assertBody("this is another test");
312312
}
313313

314314
@Test
315315
public void testPostMultipleFiles()throws Exception {
316316
Unirest.post(MockServer.POST)
317317
.field("param3", "wot")
318-
.field("file1", rezFile("/test"))
319-
.field("file2", rezFile("/test"))
318+
.field("file1", rezFile("/test.txt"))
319+
.field("file2", rezFile("/test.txt"))
320320
.asObject(RequestCapture.class)
321321
.getBody()
322322
.assertMultiPartContentType()
@@ -330,7 +330,7 @@ public void testPostBinaryUTF8() throws Exception {
330330
Unirest.post(MockServer.POST)
331331
.header("Accept", ContentType.MULTIPART_FORM_DATA.getMimeType())
332332
.field("param3", "こんにちは")
333-
.field("file", rezFile("/test"))
333+
.field("file", rezFile("/test.txt"))
334334
.asObject(RequestCapture.class)
335335
.getBody()
336336
.assertMultiPartContentType()
@@ -341,7 +341,7 @@ public void testPostBinaryUTF8() throws Exception {
341341
@Test
342342
public void testMultipeInputStreams() throws FileNotFoundException {
343343
Unirest.post(MockServer.POST)
344-
.field("name", asList(new FileInputStream(rezFile("/test")), new FileInputStream(rezFile("/test2"))))
344+
.field("name", asList(new FileInputStream(rezFile("/test.txt")), new FileInputStream(rezFile("/test2.txt"))))
345345
.asObject(RequestCapture.class)
346346
.getBody()
347347
.assertMultiPartContentType()
@@ -353,7 +353,7 @@ public void testMultipeInputStreams() throws FileNotFoundException {
353353
public void multiPartInputStream() throws FileNotFoundException {
354354
Unirest.post(MockServer.POST)
355355
.field("foo", "bar")
356-
.field("filecontents", new FileInputStream(rezFile("/test")), ContentType.WILDCARD)
356+
.field("filecontents", new FileInputStream(rezFile("/test.txt")), ContentType.WILDCARD)
357357
.asObject(RequestCapture.class)
358358
.getBody()
359359
.assertMultiPartContentType()
@@ -401,7 +401,7 @@ public void rawInspection() {
401401
String body = Unirest.post(MockServer.ECHO_RAW)
402402
.field("marky","mark")
403403
.field("funky","bunch")
404-
.field("file", rezFile("/test"))
404+
.field("file", rezFile("/test.txt"))
405405
.asString()
406406
.getBody();
407407

unirest/src/test/java/BehaviorTests/UploadProgressTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void canAddUploadProgressAsync() throws Exception {
6868
public void canKeepTrackOfMultipleFiles() {
6969
Unirest.post(MockServer.POST)
7070
.field("spidey", monitor.spidey)
71-
.field("other", rezFile("/test"))
71+
.field("other", rezFile("/test.txt"))
7272
.uploadMonitor(monitor)
7373
.asEmpty();
7474

@@ -87,7 +87,7 @@ public void canMonitorIfPassedAsInputStream() throws Exception {
8787
}
8888

8989
private void assertOtherFileUpload() {
90-
TestMonitor.Stats stat = monitor.get("test");
90+
TestMonitor.Stats stat = monitor.get("test.txt");
9191
assertEquals(1, stat.timesCalled);
9292
assertEquals(asList(19L), stat.progress);
9393
assertEquals(19L, stat.total);

unirest/src/test/resources/rawPost.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--IDENTIFIER
2-
Content-Disposition: form-data; name="file"; filename="test"
2+
Content-Disposition: form-data; name="file"; filename="test.txt"
33
Content-Type: application/octet-stream
44

55
This is a test file
File renamed without changes.

0 commit comments

Comments
 (0)