Skip to content

Commit b126d5e

Browse files
author
CI
committed
Releasing version 1.0.140
1 parent 7c060da commit b126d5e

3 files changed

Lines changed: 81 additions & 6 deletions

File tree

examples/async-thumbnails/pom.xml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<dependency>
6161
<groupId>io.minio</groupId>
6262
<artifactId>minio</artifactId>
63-
<version>5.0.1</version>
63+
<version>7.1.3</version>
6464
</dependency>
6565
<dependency>
6666
<groupId>com.fnproject.fn</groupId>
@@ -91,6 +91,71 @@
9191
<groupId>com.github.tomakehurst</groupId>
9292
<artifactId>wiremock</artifactId>
9393
<version>2.27.2</version>
94+
<exclusions>
95+
<exclusion>
96+
<groupId>com.jayway.jsonpath</groupId>
97+
<artifactId>json-path</artifactId>
98+
</exclusion>
99+
<exclusion>
100+
<groupId>com.github.jknack</groupId>
101+
<artifactId>handlebars</artifactId>
102+
</exclusion>
103+
<exclusion>
104+
<groupId>org.apache.httpcomponents</groupId>
105+
<artifactId>httpclient</artifactId>
106+
</exclusion>
107+
</exclusions>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>org.eclipse.jetty</groupId>
112+
<artifactId>jetty-server</artifactId>
113+
<version>9.4.44.v20210927</version>
114+
</dependency>
115+
<dependency>
116+
<groupId>org.eclipse.jetty</groupId>
117+
<artifactId>jetty-servlet</artifactId>
118+
<version>9.4.44.v20210927</version>
119+
</dependency>
120+
<dependency>
121+
<groupId>org.eclipse.jetty</groupId>
122+
<artifactId>jetty-servlets</artifactId>
123+
<version>9.4.44.v20210927</version>
124+
</dependency>
125+
<dependency>
126+
<groupId>org.eclipse.jetty</groupId>
127+
<artifactId>jetty-webapp</artifactId>
128+
<version>9.4.44.v20210927</version>
129+
</dependency>
130+
131+
<dependency>
132+
<groupId>com.jayway.jsonpath</groupId>
133+
<artifactId>json-path</artifactId>
134+
<version>2.6.0</version>
135+
</dependency>
136+
137+
<dependency>
138+
<groupId>com.github.jknack</groupId>
139+
<artifactId>handlebars</artifactId>
140+
<version>4.2.1</version>
141+
</dependency>
142+
143+
<dependency>
144+
<groupId>org.apache.httpcomponents</groupId>
145+
<artifactId>httpclient</artifactId>
146+
<version>4.5.13</version>
147+
<exclusions>
148+
<exclusion>
149+
<groupId>commons-codec</groupId>
150+
<artifactId>commons-codec</artifactId>
151+
</exclusion>
152+
</exclusions>
153+
</dependency>
154+
155+
<dependency>
156+
<groupId>commons-codec</groupId>
157+
<artifactId>commons-codec</artifactId>
158+
<version>1.15</version>
94159
</dependency>
95160
</dependencies>
96161

examples/async-thumbnails/src/main/java/com/fnproject/fn/examples/ThumbnailsFunction.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
import com.fnproject.fn.runtime.flow.FlowFeature;
2424
import com.fnproject.fn.api.flow.Flows;
2525
import com.fnproject.fn.api.flow.HttpMethod;
26+
import io.minio.BucketExistsArgs;
27+
import io.minio.MakeBucketArgs;
2628
import io.minio.MinioClient;
29+
import io.minio.PutObjectArgs;
2730

2831
import java.io.ByteArrayInputStream;
2932
import java.io.Serializable;
@@ -85,15 +88,22 @@ public Response handleRequest(byte[] imageBuffer) {
8588
*/
8689
private void objectUpload(byte[] imageBuffer, String objectName) {
8790
try {
88-
MinioClient minioClient = new MinioClient(storageUrl, storageAccessKey, storageSecretKey);
91+
MinioClient minioClient = MinioClient.builder()
92+
.endpoint(storageUrl).credentials(storageAccessKey, storageSecretKey).build();
8993

9094
// Ensure the bucket exists.
91-
if(!minioClient.bucketExists("alpha")) {
92-
minioClient.makeBucket("alpha");
95+
BucketExistsArgs bucketExistsArgs = BucketExistsArgs.builder().bucket("alpha").build();
96+
MakeBucketArgs makeBucketArgs = MakeBucketArgs.builder().bucket("alpha").build();
97+
if(!minioClient.bucketExists(bucketExistsArgs)) {
98+
minioClient.makeBucket(makeBucketArgs);
9399
}
94100

101+
PutObjectArgs putObjectArgs = PutObjectArgs.builder()
102+
.bucket("alpha")
103+
.object(objectName)
104+
.stream(new ByteArrayInputStream(imageBuffer), imageBuffer.length, -1).build();
95105
// Upload the image to the bucket with putObject
96-
minioClient.putObject("alpha", objectName, new ByteArrayInputStream(imageBuffer), imageBuffer.length, "application/octet-stream");
106+
minioClient.putObject(putObjectArgs);
97107
} catch(Exception e) {
98108
System.err.println("Error occurred: " + e);
99109
e.printStackTrace();

release.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.139
1+
1.0.140

0 commit comments

Comments
 (0)