Class OutputDir


  • @API(status=INTERNAL,
         since="1.9")
    public class OutputDir
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.Path path  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private OutputDir​(java.nio.file.Path path)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean containsFilesWithExtensions​(java.nio.file.Path dir, java.lang.String... extensions)
      Determine if the supplied directory contains files with any of the supplied extensions.
      static OutputDir create​(java.util.Optional<java.lang.String> customDir)  
      java.nio.file.Path createFile​(java.lang.String prefix, java.lang.String extension)  
      (package private) static OutputDir createSafely​(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir)
      Package private for testing purposes.
      java.nio.file.Path toPath()  
      • Methods inherited from class java.lang.Object

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

      • path

        private final java.nio.file.Path path
    • Constructor Detail

      • OutputDir

        private OutputDir​(java.nio.file.Path path)
    • Method Detail

      • create

        public static OutputDir create​(java.util.Optional<java.lang.String> customDir)
      • createSafely

        static OutputDir createSafely​(java.util.Optional<java.lang.String> customDir,
                                      java.util.function.Supplier<java.nio.file.Path> currentWorkingDir)
                               throws java.io.IOException
        Package private for testing purposes.
        Throws:
        java.io.IOException
      • toPath

        public java.nio.file.Path toPath()
      • createFile

        public java.nio.file.Path createFile​(java.lang.String prefix,
                                             java.lang.String extension)
                                      throws java.io.UncheckedIOException
        Throws:
        java.io.UncheckedIOException
      • containsFilesWithExtensions

        private static boolean containsFilesWithExtensions​(java.nio.file.Path dir,
                                                           java.lang.String... extensions)
                                                    throws java.io.IOException
        Determine if the supplied directory contains files with any of the supplied extensions.
        Throws:
        java.io.IOException