234 * options may be present: |
234 * options may be present: |
235 * |
235 * |
236 * <table class="striped"> |
236 * <table class="striped"> |
237 * <caption style="display:none">Options</caption> |
237 * <caption style="display:none">Options</caption> |
238 * <thead> |
238 * <thead> |
239 * <tr> <th>Option</th> <th>Description</th> </tr> |
239 * <tr> <th scope="col">Option</th> <th scope="col">Description</th> </tr> |
240 * </thead> |
240 * </thead> |
241 * <tbody> |
241 * <tbody> |
242 * <tr> |
242 * <tr> |
243 * <td> {@link StandardOpenOption#APPEND APPEND} </td> |
243 * <th scope="row"> {@link StandardOpenOption#APPEND APPEND} </th> |
244 * <td> If this option is present then the file is opened for writing and |
244 * <td> If this option is present then the file is opened for writing and |
245 * each invocation of the channel's {@code write} method first advances |
245 * each invocation of the channel's {@code write} method first advances |
246 * the position to the end of the file and then writes the requested |
246 * the position to the end of the file and then writes the requested |
247 * data. Whether the advancement of the position and the writing of the |
247 * data. Whether the advancement of the position and the writing of the |
248 * data are done in a single atomic operation is system-dependent and |
248 * data are done in a single atomic operation is system-dependent and |
249 * therefore unspecified. This option may not be used in conjunction |
249 * therefore unspecified. This option may not be used in conjunction |
250 * with the {@code READ} or {@code TRUNCATE_EXISTING} options. </td> |
250 * with the {@code READ} or {@code TRUNCATE_EXISTING} options. </td> |
251 * </tr> |
251 * </tr> |
252 * <tr> |
252 * <tr> |
253 * <td> {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} </td> |
253 * <th scope="row"> {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} </th> |
254 * <td> If this option is present then the existing file is truncated to |
254 * <td> If this option is present then the existing file is truncated to |
255 * a size of 0 bytes. This option is ignored when the file is opened only |
255 * a size of 0 bytes. This option is ignored when the file is opened only |
256 * for reading. </td> |
256 * for reading. </td> |
257 * </tr> |
257 * </tr> |
258 * <tr> |
258 * <tr> |
259 * <td> {@link StandardOpenOption#CREATE_NEW CREATE_NEW} </td> |
259 * <th scope="row"> {@link StandardOpenOption#CREATE_NEW CREATE_NEW} </th> |
260 * <td> If this option is present then a new file is created, failing if |
260 * <td> If this option is present then a new file is created, failing if |
261 * the file already exists or is a symbolic link. When creating a file the |
261 * the file already exists or is a symbolic link. When creating a file the |
262 * check for the existence of the file and the creation of the file if it |
262 * check for the existence of the file and the creation of the file if it |
263 * does not exist is atomic with respect to other file system operations. |
263 * does not exist is atomic with respect to other file system operations. |
264 * This option is ignored when the file is opened only for reading. </td> |
264 * This option is ignored when the file is opened only for reading. </td> |
265 * </tr> |
265 * </tr> |
266 * <tr> |
266 * <tr> |
267 * <td > {@link StandardOpenOption#CREATE CREATE} </td> |
267 * <th scope="row" > {@link StandardOpenOption#CREATE CREATE} </th> |
268 * <td> If this option is present then an existing file is opened if it |
268 * <td> If this option is present then an existing file is opened if it |
269 * exists, otherwise a new file is created. This option is ignored if the |
269 * exists, otherwise a new file is created. This option is ignored if the |
270 * {@code CREATE_NEW} option is also present or the file is opened only |
270 * {@code CREATE_NEW} option is also present or the file is opened only |
271 * for reading. </td> |
271 * for reading. </td> |
272 * </tr> |
272 * </tr> |
273 * <tr> |
273 * <tr> |
274 * <td > {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} </td> |
274 * <th scope="row" > {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} </th> |
275 * <td> When this option is present then the implementation makes a |
275 * <td> When this option is present then the implementation makes a |
276 * <em>best effort</em> attempt to delete the file when closed by the |
276 * <em>best effort</em> attempt to delete the file when closed by the |
277 * {@link SeekableByteChannel#close close} method. If the {@code close} |
277 * {@link SeekableByteChannel#close close} method. If the {@code close} |
278 * method is not invoked then a <em>best effort</em> attempt is made to |
278 * method is not invoked then a <em>best effort</em> attempt is made to |
279 * delete the file when the Java virtual machine terminates. </td> |
279 * delete the file when the Java virtual machine terminates. </td> |
280 * </tr> |
280 * </tr> |
281 * <tr> |
281 * <tr> |
282 * <td>{@link StandardOpenOption#SPARSE SPARSE} </td> |
282 * <th scope="row">{@link StandardOpenOption#SPARSE SPARSE} </th> |
283 * <td> When creating a new file this option is a <em>hint</em> that the |
283 * <td> When creating a new file this option is a <em>hint</em> that the |
284 * new file will be sparse. This option is ignored when not creating |
284 * new file will be sparse. This option is ignored when not creating |
285 * a new file. </td> |
285 * a new file. </td> |
286 * </tr> |
286 * </tr> |
287 * <tr> |
287 * <tr> |
288 * <td> {@link StandardOpenOption#SYNC SYNC} </td> |
288 * <th scope="row"> {@link StandardOpenOption#SYNC SYNC} </th> |
289 * <td> Requires that every update to the file's content or metadata be |
289 * <td> Requires that every update to the file's content or metadata be |
290 * written synchronously to the underlying storage device. (see <a |
290 * written synchronously to the underlying storage device. (see <a |
291 * href="package-summary.html#integrity"> Synchronized I/O file |
291 * href="package-summary.html#integrity"> Synchronized I/O file |
292 * integrity</a>). </td> |
292 * integrity</a>). </td> |
293 * </tr> |
293 * </tr> |
294 * <tr> |
294 * <tr> |
295 * <td> {@link StandardOpenOption#DSYNC DSYNC} </td> |
295 * <th scope="row"> {@link StandardOpenOption#DSYNC DSYNC} </th> |
296 * <td> Requires that every update to the file's content be written |
296 * <td> Requires that every update to the file's content be written |
297 * synchronously to the underlying storage device. (see <a |
297 * synchronously to the underlying storage device. (see <a |
298 * href="package-summary.html#integrity"> Synchronized I/O file |
298 * href="package-summary.html#integrity"> Synchronized I/O file |
299 * integrity</a>). </td> |
299 * integrity</a>). </td> |
300 * </tr> |
300 * </tr> |
1194 * <p> The {@code options} parameter may include any of the following: |
1194 * <p> The {@code options} parameter may include any of the following: |
1195 * |
1195 * |
1196 * <table class="striped"> |
1196 * <table class="striped"> |
1197 * <caption style="display:none">Options</caption> |
1197 * <caption style="display:none">Options</caption> |
1198 * <thead> |
1198 * <thead> |
1199 * <tr> <th>Option</th> <th>Description</th> </tr> |
1199 * <tr> <th scope="col">Option</th> <th scope="col">Description</th> </tr> |
1200 * </thead> |
1200 * </thead> |
1201 * <tbody> |
1201 * <tbody> |
1202 * <tr> |
1202 * <tr> |
1203 * <td> {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} </td> |
1203 * <th scope="row"> {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} </th> |
1204 * <td> If the target file exists, then the target file is replaced if it |
1204 * <td> If the target file exists, then the target file is replaced if it |
1205 * is not a non-empty directory. If the target file exists and is a |
1205 * is not a non-empty directory. If the target file exists and is a |
1206 * symbolic link, then the symbolic link itself, not the target of |
1206 * symbolic link, then the symbolic link itself, not the target of |
1207 * the link, is replaced. </td> |
1207 * the link, is replaced. </td> |
1208 * </tr> |
1208 * </tr> |
1209 * <tr> |
1209 * <tr> |
1210 * <td> {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} </td> |
1210 * <th scope="row"> {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} </th> |
1211 * <td> Attempts to copy the file attributes associated with this file to |
1211 * <td> Attempts to copy the file attributes associated with this file to |
1212 * the target file. The exact file attributes that are copied is platform |
1212 * the target file. The exact file attributes that are copied is platform |
1213 * and file system dependent and therefore unspecified. Minimally, the |
1213 * and file system dependent and therefore unspecified. Minimally, the |
1214 * {@link BasicFileAttributes#lastModifiedTime last-modified-time} is |
1214 * {@link BasicFileAttributes#lastModifiedTime last-modified-time} is |
1215 * copied to the target file if supported by both the source and target |
1215 * copied to the target file if supported by both the source and target |
1216 * file stores. Copying of file timestamps may result in precision |
1216 * file stores. Copying of file timestamps may result in precision |
1217 * loss. </td> |
1217 * loss. </td> |
1218 * </tr> |
1218 * </tr> |
1219 * <tr> |
1219 * <tr> |
1220 * <td> {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} </td> |
1220 * <th scope="row"> {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} </th> |
1221 * <td> Symbolic links are not followed. If the file is a symbolic link, |
1221 * <td> Symbolic links are not followed. If the file is a symbolic link, |
1222 * then the symbolic link itself, not the target of the link, is copied. |
1222 * then the symbolic link itself, not the target of the link, is copied. |
1223 * It is implementation specific if file attributes can be copied to the |
1223 * It is implementation specific if file attributes can be copied to the |
1224 * new link. In other words, the {@code COPY_ATTRIBUTES} option may be |
1224 * new link. In other words, the {@code COPY_ATTRIBUTES} option may be |
1225 * ignored when copying a symbolic link. </td> |
1225 * ignored when copying a symbolic link. </td> |
1317 * <p> The {@code options} parameter may include any of the following: |
1317 * <p> The {@code options} parameter may include any of the following: |
1318 * |
1318 * |
1319 * <table class="striped"> |
1319 * <table class="striped"> |
1320 * <caption style="display:none">Options</caption> |
1320 * <caption style="display:none">Options</caption> |
1321 * <thead> |
1321 * <thead> |
1322 * <tr> <th>Option</th> <th>Description</th> </tr> |
1322 * <tr> <th scope="col">Option</th> <th scope="col">Description</th> </tr> |
1323 * </thead> |
1323 * </thead> |
1324 * <tbody> |
1324 * <tbody> |
1325 * <tr> |
1325 * <tr> |
1326 * <td> {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} </td> |
1326 * <th scope="row"> {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} </th> |
1327 * <td> If the target file exists, then the target file is replaced if it |
1327 * <td> If the target file exists, then the target file is replaced if it |
1328 * is not a non-empty directory. If the target file exists and is a |
1328 * is not a non-empty directory. If the target file exists and is a |
1329 * symbolic link, then the symbolic link itself, not the target of |
1329 * symbolic link, then the symbolic link itself, not the target of |
1330 * the link, is replaced. </td> |
1330 * the link, is replaced. </td> |
1331 * </tr> |
1331 * </tr> |
1332 * <tr> |
1332 * <tr> |
1333 * <td> {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} </td> |
1333 * <th scope="row"> {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} </th> |
1334 * <td> The move is performed as an atomic file system operation and all |
1334 * <td> The move is performed as an atomic file system operation and all |
1335 * other options are ignored. If the target file exists then it is |
1335 * other options are ignored. If the target file exists then it is |
1336 * implementation specific if the existing file is replaced or this method |
1336 * implementation specific if the existing file is replaced or this method |
1337 * fails by throwing an {@link IOException}. If the move cannot be |
1337 * fails by throwing an {@link IOException}. If the move cannot be |
1338 * performed as an atomic file system operation then {@link |
1338 * performed as an atomic file system operation then {@link |