You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/content/driver/tutorials/gridfs.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ To upload data into GridFS, you can upload from an `InputStream` or write data t
79
79
80
80
### UploadFromStream
81
81
82
-
The [`GridFSBucket.uploadFromStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSBucket.html#openUploadStream(java.lang.String,com.mongodb.client.gridfs.model.GridFSUploadOptions)" >}}) method reads the contents of an [`InputStream`](http://docs.oracle.com/javase/8/docs/api/index.html?java/io/InputStream.html) and saves it to the `GridFSBucket`.
82
+
The [`GridFSBucket.uploadFromStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSBucket.html#openUploadStream(java.lang.String,com.mongodb.client.gridfs.model.GridFSUploadOptions)" >}}) method reads the contents of an [`InputStream`]({{< javaseref "api/java/io/InputStream.html" >}}) and saves it to the `GridFSBucket`.
83
83
84
84
You can use the [`GridFSUploadOptions`]({{< apiref "mongodb-driver-core" "com/mongodb/client/gridfs/model/GridFSUploadOptions" >}}) to configure the chunk size or include additional metadata.
85
85
@@ -104,7 +104,7 @@ try {
104
104
### OpenUploadStream
105
105
106
106
You can write data to a [`GridFSUploadStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSUploadStream.html" >}}) which extends
107
-
[`OutputStream`](http://docs.oracle.com/javase/8/docs/api/index.html?java/io/OutputStream.html). The
107
+
[`OutputStream`]({{< javaseref "api/java/io/OutputStream.html" >}}). The
method returns a [`GridFSUploadStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSUploadStream.html" >}}).
110
110
@@ -154,7 +154,7 @@ There are various ways to download data from GridFS.
154
154
155
155
### DownloadToStream
156
156
157
-
The [`downloadToStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSBucket.html#downloadToStream(org.bson.types.ObjectId,java.io.OutputStream)" >}}) method reads the contents from MongoDB and writes the data directly to the provided [`OutputStream`](http://docs.oracle.com/javase/8/docs/api/index.html?java/io/OutputStream.html).
157
+
The [`downloadToStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSBucket.html#downloadToStream(org.bson.types.ObjectId,java.io.OutputStream)" >}}) method reads the contents from MongoDB and writes the data directly to the provided [`OutputStream`]({{< javaseref "api/java/io/OutputStream.html" >}}).
158
158
159
159
To download a file by its file `_id`, pass the `_id` to the method. The
160
160
following example downloads a file by its file `_id` into the provided
@@ -193,7 +193,7 @@ try {
193
193
### OpenDownloadStream
194
194
195
195
196
-
The [`openDownloadStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSBucket.html#openDownloadStream(org.bson.types.ObjectId)" >}}) method returns a [`GridFSDownloadStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSDownloadStream.html" >}}) which extends [`InputStream`](http://docs.oracle.com/javase/8/docs/api/index.html?java/io/InputStream.html).
196
+
The [`openDownloadStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSBucket.html#openDownloadStream(org.bson.types.ObjectId)" >}}) method returns a [`GridFSDownloadStream`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/gridfs/GridFSDownloadStream.html" >}}) which extends [`InputStream`]({{< javaseref "api/java/io/InputStream.html" >}}).
197
197
198
198
The following example reads from the `GridFSBucket` via the returned `InputStream`:
Copy file name to clipboardExpand all lines: docs/reference/content/driver/tutorials/jndi.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ title = "JNDI"
10
10
11
11
## Java Naming and Directory Interface (JNDI)
12
12
13
-
The driver includes a [JNDI](http://docs.oracle.com/javase/8/docs/technotes/guides/jndi/index.html) ObjectFactory implementation,
13
+
The driver includes a [JNDI]({{< javaseref "technotes/guides/jndi/index.html" >}}) ObjectFactory implementation,
14
14
[`MongoClientFactory`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/MongoClientFactory" >}}) ([`legacy version`]({{< apiref "mongodb-driver-legacy" "com/mongodb/client/jndi/MongoClientFactory" >}})), that returns `MongoClient` instances based on a
## Common TLS/SSL Configuration Tasks <!-- Care when renaming, this section is referred to in driver-reactive/tutorials/ssl.md and driver-scala/tutorials/ssl.md -->
command line program provided as part of the JDK. For example:
160
173
161
174
```bash
162
175
keytool -importcert -trustcacerts -file <path to certificate authority file>
163
-
-keystore <path to trust store> -storepass <password>
176
+
-keystore <path to trust store> -storepass <trust store password>
164
177
```
178
+
179
+
#### Set the Default Key Store
180
+
165
181
A typical application will also need to set several JVM system
166
-
properties to ensure that the client presents an TLS/SSL certificate to the
182
+
properties to ensure that the client *presents* an TLS/SSL [client certificate](https://docs.mongodb.com/manual/tutorial/configure-ssl/#set-up-mongod-and-mongos-with-client-certificate-validation) to the
167
183
MongoDB server:
168
184
169
185
-`javax.net.ssl.keyStore`
170
186
The path to a key store containing the client's TLS/SSL certificates
-out <path to key store> -passout pass:<trust store password>
204
+
```
179
205
180
206
For more information on configuring a Java application for TLS/SSL, please
181
-
refer to the [`JSSE Reference Guide`](http://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSS
182
-
ERefGuide.html).
207
+
refer to the [`JSSE Reference Guide`]({{< javaseref "technotes/guides/security/jsse/JSSERefGuide.html" >}}).
183
208
184
209
185
210
### Forcing TLS 1.2
@@ -189,13 +214,13 @@ Some applications may want to force only the TLS 1.2 protocol. To do this, set t
189
214
Java runtime environments prior to Java 8 started to enable the TLS 1.2 protocol only in later updates, as shown in the previous section. For the driver to force the use of the TLS 1.2 protocol with a Java runtime environment prior to Java 8, ensure that the update has TLS 1.2 enabled.
190
215
191
216
192
-
## OCSP
217
+
###OCSP
193
218
194
219
{{% note %}}
195
220
The Java driver cannot enable OCSP by default on a per MongoClient basis.
196
221
{{% /note %}}
197
222
198
-
### Client-driven OCSP
223
+
####Client-driven OCSP
199
224
200
225
An application will need to set JVM system and security properties to ensure that client-driven OCSP is enabled:
201
226
@@ -211,7 +236,7 @@ To configure an application to use client-driven OCSP, the application must alre
211
236
The support for TLS provided by the JDK utilizes “hard fail” behavior in the case of an unavailable OCSP responder in contrast to the mongo shell and drivers that utilize “soft fail” behavior.
212
237
{{% /note %}}
213
238
214
-
### OCSP Stapling
239
+
####OCSP Stapling
215
240
216
241
{{% note class="important" %}}
217
242
The following exception may occur when using OCSP stapling with Java runtime environments that use the TLS 1.3 protocol (Java 11 and higher use TLS 1.3 by default):
@@ -232,4 +257,4 @@ An application will need to set several JVM system properties to set up OCSP sta
232
257
To configure an application to use OCSP stapling, the application must already be set up to connect to a server using TLS, and the server must be set up to staple an OCSP response to the certificate it returns as part of the the TLS handshake.
233
258
234
259
For more information on configuring a Java application to use OCSP, please
235
-
refer to the "Client-driven OCSP and OCSP Stapling" section in the [`JSSE Reference Guide`](https://docs.oracle.com/javase/9/security/java-secure-socket-extension-jsse-reference-guide.htm).
260
+
refer to the [`Client-Driven OCSP and OCSP Stapling`]({{< javaseref "technotes/guides/security/jsse/ocsp.html" >}}).
0 commit comments