return repository.getProperty(IRedmineConstants.REPOSITORY_SETTING_API_KEY);
}
@Override
public Credentials getRepositoryCredentials() {
AuthenticationCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY);
if(credentials!=null && !credentials.getUserName().isEmpty()) {
try {
URL url = new URL(location.getUrl());
String host = url.getHost();
String username = credentials.getUserName();
String password = credentials.getPassword();
Credentials httpCredentials = new UsernamePasswordCredentials(username, password);
int i = username.indexOf("\\"); //$NON-NLS-1$
if (i > 0 && i < username.length() - 1 && host != null) {
httpCredentials = new NTCredentials(username.substring(i + 1), password, host, username.substring(0, i));