Example usage for java.nio.file StandardOpenOption DSYNC

List of usage examples for java.nio.file StandardOpenOption DSYNC

Introduction

In this page you can find the example usage for java.nio.file StandardOpenOption DSYNC.

Prototype

StandardOpenOption DSYNC

To view the source code for java.nio.file StandardOpenOption DSYNC.

Click Source Link

Document

Requires that every update to the file's content be written synchronously to the underlying storage device.

Usage

From source file:org.cryptomator.webdav.jackrabbit.DavLocatorFactoryImpl.java

@Override
public void writePathSpecificMetadata(String encryptedPath, byte[] encryptedMetadata) throws IOException {
    final Path metaDataFile = fsRoot.resolve(encryptedPath);
    Files.write(metaDataFile, encryptedMetadata, StandardOpenOption.WRITE, StandardOpenOption.CREATE,
            StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.DSYNC);
}

From source file:org.neo4j.io.pagecache.PageCacheTest.java

@Test(timeout = SEMI_LONG_TIMEOUT_MILLIS)
public void mustThrowOnUnsupportedOpenOptions() throws Exception {
    getPageCache(fs, maxPages, pageCachePageSize, PageCacheTracer.NULL);
    verifyMappingWithOpenOptionThrows(StandardOpenOption.CREATE_NEW);
    verifyMappingWithOpenOptionThrows(StandardOpenOption.SYNC);
    verifyMappingWithOpenOptionThrows(StandardOpenOption.DSYNC);
    verifyMappingWithOpenOptionThrows(new OpenOption() {
        @Override//from  www .ja v a 2  s  .  c o  m
        public String toString() {
            return "NonStandardOpenOption";
        }
    });
}