@Path(value="/mongodb-gridfs") public class MongodbGridfsResource extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static String |
DEFAULT_MONGO_CLIENT_NAME |
(package private) static String |
NAMED_MONGO_CLIENT_NAME |
(package private) com.mongodb.client.MongoClient |
namedMongoClient |
(package private) org.apache.camel.ProducerTemplate |
producerTemplate |
| Constructor and Description |
|---|
MongodbGridfsResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
deleteFile(String fileName,
String mongoClientName) |
javax.ws.rs.core.Response |
retrieveFile(String fileName,
String mongoClientName) |
javax.ws.rs.core.Response |
uploadFile(String fileName,
String content,
String mongoClientName) |
static final String DEFAULT_MONGO_CLIENT_NAME
static final String NAMED_MONGO_CLIENT_NAME
@Inject @MongoClientName(value="myMongoClient") com.mongodb.client.MongoClient namedMongoClient
@Inject org.apache.camel.ProducerTemplate producerTemplate
@Path(value="/upload/{fileName}")
@POST
@Produces(value="text/plain")
public javax.ws.rs.core.Response uploadFile(@PathParam(value="fileName")
String fileName,
String content,
@HeaderParam(value="mongoClientName")
String mongoClientName)
throws Exception
Exception@Path(value="/get/{fileName}")
@GET
@Produces(value="text/plain")
public javax.ws.rs.core.Response retrieveFile(@PathParam(value="fileName")
String fileName,
@HeaderParam(value="mongoClientName")
String mongoClientName)
Copyright © 2019–2020 The Apache Software Foundation. All rights reserved.