Java tutorial
//package com.java2s; //License from project: Apache License import java.net.URL; public class Main { /** * Checks if URL needs Authentication by checking if the domain is bitbucket.org or * api.bitbucket.org. */ public static Boolean urlNeedsAuthentication(URL url) { return "bitbucket.org".equals(url.getHost().toLowerCase()) || "api.bitbucket.org".equals(url.getHost().toLowerCase()); } }