@Override public synchronized Path createDirectories( final Path dir, final FileAttribute<?>... attrs ) throws UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException { final Path result = Files.createDirectories( dir, attrs ); buildDotFile( dir, newOutputStream( dot( dir ) ), attrs ); return result; }
deleteIfExists( dot( path ) ); tempDot = File.createTempFile( "meta", "dot" ); buildDotFile( path, new FileOutputStream( tempDot ), attrs );
protected synchronized Path internalCreateDirectory( final Path dir, final boolean skipAlreadyExistsException, final FileAttribute<?>... attrs ) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException { checkNotNull( "dir", dir ); FileAttribute<?>[] allAttrs = attrs; try { Files.createDirectory( dir, attrs ); } catch ( final FileAlreadyExistsException ex ) { final Properties properties = new Properties(); if ( exists( dot( dir ) ) ) { properties.load( newInputStream( dot( dir ) ) ); } allAttrs = consolidate( properties, attrs ); if ( !skipAlreadyExistsException ) { throw ex; } } buildDotFile( dir, newOutputStream( dot( dir ) ), allAttrs ); return dir; }
@Override public synchronized SeekableByteChannel newByteChannel( final Path path, final Set<? extends OpenOption> options, final FileAttribute<?>... attrs ) throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException { checkNotNull( "path", path ); final Properties properties = new Properties(); if ( exists( dot( path ) ) ) { properties.load( newInputStream( dot( path ) ) ); } final FileAttribute<?>[] allAttrs = consolidate( properties, attrs ); final SeekableByteChannel result = Files.newByteChannel( path, buildOptions( options ), allAttrs ); if ( isFileScheme( path ) ) { buildDotFile( path, newOutputStream( dot( path ) ), allAttrs ); } return result; }