public RegularFile getOrCreateRegularFile ( JimfsPath path , Set < OpenOption > options , FileAttribute < ? > ... attrs ) throws IOException { checkNotNull ( path ) ; if ( ! options . contains ( CREATE_NEW ) ) { // assume file exists unless we're explicitly trying to create a new file RegularFile file = lookUpRegularFile ( path , options ) ; if ( file != null ) { return file ; } } if ( options . contains ( CREATE ) || options . contains ( CREATE_NEW ) ) { return getOrCreateRegularFileWithWriteLock ( path , options , attrs ) ; } else { throw new NoSuchFileException ( path . toString ( ) ) ; } }
Gets the regular file at the given path creating it if it doesn t exist and the given options specify that it should be created .