public static Optional < Path > createTempDirPathAsOpt ( Path path ) { debug ( log , "createTempDirPathAsOpt" , path ) ; try { return Optional . of ( Files . createTempDirectory ( path . toString ( ) ) ) . filter ( JMPath . ExistFilter ) . map ( JMPathOperation :: deleteOnExit ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnEmptyOptional ( log , e , "createTempDirPathAsOpt" , path ) ; } }
Create temp dir path as opt optional .