question: private static String guessContentType ( String url ) { url = url . toLowerCase ( ) ; if ( url . endsWith ( ".webm" ) ) { return "video/webm" ; } else if ( url . endsWith ( ".mp4" ) ) { return "video/mp4" ; } else if ( url . matches ( ".*\\.jpe?g" ) ) { return "image/jpeg" ; } else if ( url . endsWith ( ".png" ) ) { return "image/png" ; } else if ( url . endsWith ( ".gif" ) ) { return "image/gif" ; } else { return "application/octet-stream" ; } }
target:  Guess a content type from the URL.