class FileUtil {

    public static boolean createNewFile( final String fileAbsPath )
    {
        if ( StringUtils.isBlank( fileAbsPath ) )
        {
            logger.error( "In createNewFile, file absolute path '{}' is either null or blank.", fileAbsPath );
            return false;
        }
        File file = new File( fileAbsPath );
        String parent = file.getParent();
        File parentFile = new File( parent );
        if ( parentFile.exists() && parentFile.isDirectory() )
        {
            return FileUtil.createNewFile( file );
        }
        else
        {
            if ( FileUtil.createDirectory( parentFile.getAbsolutePath() ) )
            {
                return FileUtil.createNewFile( file );
            }
            else
            {
                logger.error( "In createNewFile, failed to create parent directory '{}' for creating file '{}'.",
                              parentFile.getAbsolutePath(), fileAbsPath );
                return false;
            }
        }
    }

    private  FileUtil();

}