Module life.expert

Class FileUtils


  • public class FileUtils
    extends java.lang.Object
    The type File utils.
    
     var new_file_name = String.format( "%d.dot" , Instant.now().toEpochMilli() );
     		var new_file_flux = FileUtils.deleteFileToMono( "src/main/graphviz" )
     		                             .map( p -> p.resolve( new_file_name ) )
     		                             .log( "debug", Level.FINE, SignalType.ON_NEXT )
     		                             .flatMap( FileUtils::createFileToMono )
     		                             .flatMap( FileUtils::writerFromPath );
     		new_file_flux.subscribe( w->w.write( dot ) , logAtErrorConsumer("ERROR") , logAtInfoRunnable("COMPLETE") );
     *
    • Constructor Summary

      Constructors 
      Constructor Description
      FileUtils()  
    • Method Summary

      Modifier and Type Method Description
      static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(java.lang.String path)
      Create file mono.
      static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(java.lang.String path, java.lang.String defaultParentDirectory, java.lang.String defaultFileName)
      Create file mono.
      static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(java.nio.file.Path path)
      Create file mono.
      static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(reactor.core.publisher.Mono<java.nio.file.Path> path)
      Create file mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(java.lang.String path)
      Create file to mono mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(java.lang.String path, java.lang.String defaultParentDirectory, java.lang.String defaultFileName)
      Create file to mono mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(java.nio.file.Path path)
      Create file to mono mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(reactor.core.publisher.Mono<java.nio.file.Path> path)
      Create file to mono mono.
      static reactor.core.publisher.Mono<java.lang.Boolean> deleteFile​(java.lang.String path)
      delete file or directory recursively
      static reactor.core.publisher.Mono<java.lang.Boolean> deleteFile​(java.nio.file.Path path)
      delete file or directory recursively
      static reactor.core.publisher.Mono<java.lang.Boolean> deleteFile​(reactor.core.publisher.Mono<java.nio.file.Path> path)
      delete file or directory recursively
      static reactor.core.publisher.Mono<java.nio.file.Path> deleteFileToMono​(java.lang.String path)
      Delete file to mono mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> deleteFileToMono​(java.nio.file.Path path)
      Delete file to mono mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> deleteFileToMono​(reactor.core.publisher.Mono<java.nio.file.Path> path)
      Delete file to mono mono.
      static reactor.core.publisher.Mono<java.nio.file.Path> getPathForNewFile​(java.lang.String path, java.lang.String defaultParentDirectory, java.lang.String defaultFileName)
      Gets path for new file.
      static reactor.core.publisher.Flux<java.lang.String> linesFromPath​(java.lang.String path)
      Lines from path flux.
      static reactor.core.publisher.Flux<java.lang.String> linesFromPath​(java.nio.file.Path path)
      Lines from path flux.
      static reactor.core.publisher.Flux<java.lang.String> linesFromPath​(reactor.core.publisher.Mono<java.nio.file.Path> path)
      Lines from path flux.
      static reactor.core.publisher.Mono<java.lang.String> stringFromPath​(java.nio.file.Path path)
      Get file as one string
      static reactor.core.publisher.Mono<java.io.PrintWriter> writerFromPath​(java.io.File file)
      Write to path flux.
      static reactor.core.publisher.Mono<java.io.PrintWriter> writerFromPath​(java.lang.String path)
      Write to path flux.
      static reactor.core.publisher.Mono<java.io.PrintWriter> writerFromPath​(java.nio.file.Path path)
      Write to path flux.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileUtils

        public FileUtils()
    • Method Detail

      • stringFromPath

        public static reactor.core.publisher.Mono<java.lang.String> stringFromPath​(java.nio.file.Path path)
        Get file as one string
        Parameters:
        path - the path
        Returns:
        the mono with string or error event
      • linesFromPath

        public static reactor.core.publisher.Flux<java.lang.String> linesFromPath​(reactor.core.publisher.Mono<java.nio.file.Path> path)
        Lines from path flux.
        Parameters:
        path - the path
        Returns:
        the flux
      • linesFromPath

        public static reactor.core.publisher.Flux<java.lang.String> linesFromPath​(java.nio.file.Path path)
        Lines from path flux.
        Parameters:
        path - the path
        Returns:
        the flux
      • linesFromPath

        public static reactor.core.publisher.Flux<java.lang.String> linesFromPath​(java.lang.String path)
        Lines from path flux.
        Parameters:
        path - the path
        Returns:
        the flux
      • writerFromPath

        public static reactor.core.publisher.Mono<java.io.PrintWriter> writerFromPath​(java.io.File file)
        Write to path flux.
        
         writeToPath( file ).subscribe( w->w.write( "dot" ) );
         *
        Parameters:
        file - the file
        Returns:
        the flux
      • writerFromPath

        public static reactor.core.publisher.Mono<java.io.PrintWriter> writerFromPath​(java.nio.file.Path path)
        Write to path flux.
        writeToPath( file ).subscribe( w->w.write( "dot" ) ); 
        Parameters:
        path - the path
        Returns:
        the flux
      • writerFromPath

        public static reactor.core.publisher.Mono<java.io.PrintWriter> writerFromPath​(java.lang.String path)
        Write to path flux.
        writeToPath( file ).subscribe( w->w.write( "dot" ) ); 
        Parameters:
        path - the path
        Returns:
        the flux
      • createFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(java.nio.file.Path path)
        Create file mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • createFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(java.nio.file.Path path)
        Create file to mono mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • createFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(java.lang.String path)
        Create file mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • createFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(java.lang.String path)
        Create file to mono mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • createFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(reactor.core.publisher.Mono<java.nio.file.Path> path)
        Create file mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • createFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(reactor.core.publisher.Mono<java.nio.file.Path> path)
        Create file to mono mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • getPathForNewFile

        public static reactor.core.publisher.Mono<java.nio.file.Path> getPathForNewFile​(java.lang.String path,
                                                                                        java.lang.String defaultParentDirectory,
                                                                                        java.lang.String defaultFileName)
        Gets path for new file.
        Parameters:
        path - the path
        defaultParentDirectory - the default parent directory
        defaultFileName - the default file name
        Returns:
        the path for new file
      • createFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> createFile​(java.lang.String path,
                                                                                java.lang.String defaultParentDirectory,
                                                                                java.lang.String defaultFileName)
        Create file mono.
        Parameters:
        path - the path
        defaultParentDirectory - the default parent directory
        defaultFileName - the default file name
        Returns:
        the mono
      • createFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> createFileToMono​(java.lang.String path,
                                                                                       java.lang.String defaultParentDirectory,
                                                                                       java.lang.String defaultFileName)
        Create file to mono mono.
        Parameters:
        path - the path
        defaultParentDirectory - the default parent directory
        defaultFileName - the default file name
        Returns:
        the mono
      • deleteFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> deleteFile​(java.nio.file.Path path)
        delete file or directory recursively
        Parameters:
        path - the path
        Returns:
        the mono
      • deleteFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> deleteFileToMono​(java.nio.file.Path path)
        Delete file to mono mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • deleteFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> deleteFile​(java.lang.String path)
        delete file or directory recursively
        Parameters:
        path - the path
        Returns:
        the mono
      • deleteFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> deleteFileToMono​(java.lang.String path)
        Delete file to mono mono.
        Parameters:
        path - the path
        Returns:
        the mono
      • deleteFile

        public static reactor.core.publisher.Mono<java.lang.Boolean> deleteFile​(reactor.core.publisher.Mono<java.nio.file.Path> path)
        delete file or directory recursively
        Parameters:
        path - the path
        Returns:
        the mono
      • deleteFileToMono

        public static reactor.core.publisher.Mono<java.nio.file.Path> deleteFileToMono​(reactor.core.publisher.Mono<java.nio.file.Path> path)
        Delete file to mono mono.
        Parameters:
        path - the path
        Returns:
        the mono