new Protocol("https", socketFactory, SPConstants.SSL_DEFAULT_PORT));
this.clientFactory = clientFactory;
kdcServer = inKdcHost;
if (sharepointUrl == null) {
throw new SharepointException("sharepoint URL is null");
}
if (inUsername == null) {
throw new SharepointException("Username is null.");
}
if (inPassword == null) {
throw new SharepointException("Password is null.");
}
if (inGoogleConnectorWorkDir == null) {
throw new SharepointException("Working Directory is null.");
}
if (inFeedType == null) {
throw new SharepointException("Feed Type is null.");
}
sharepointUrl = sharepointUrl.trim();
if (sharepointUrl.endsWith(SPConstants.SLASH)) {
sharepointUrl = sharepointUrl.substring(0, sharepointUrl.lastIndexOf(SPConstants.SLASH));
}
// Why to construct a SharePoint URL with default port as 80.
try {
final URL url = new URL(sharepointUrl);
int port = url.getPort();
if (-1 == port) {
port = url.getDefaultPort();
}
siteURL = url.getProtocol() + SPConstants.URL_SEP + url.getHost()
+ SPConstants.COLON + port + url.getPath();
} catch (final MalformedURLException e) {
throw new SharepointException("Failed to construct sharepoint URL...", e);
}
if ((inDomain == null) || inDomain.trim().equals("")) {
LOGGER.log(Level.CONFIG, "Trying to get domain information from username specified [ "
+ inUsername