private void validateArguments ( ) throws BuildException { Path tempDir = getTempDir ( ) ; if ( tempDir == null ) { throw new BuildException ( "Temporary directory cannot be null." ) ; } if ( Files . exists ( tempDir ) ) { if ( ! Files . isDirectory ( tempDir ) ) { throw new BuildException ( "Temporary directory is not a folder: " + tempDir . toAbsolutePath ( ) ) ; } } else { try { Files . createDirectories ( tempDir ) ; } catch ( IOException e ) { throw new BuildException ( "Failed to create temporary folder: " + tempDir , e ) ; } } }
Validate arguments .