Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ca020a5eded3464ac1459b9f3ac41227f76ca9a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * Copyright (c) 2012 SAP AG.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Stefan Lay (SAP AG) - initial implementation
 *******************************************************************************/
package org.eclipse.egit.ui.internal.provisional.wizards;

import java.net.URI;

import org.eclipse.egit.core.securestorage.UserPasswordCredentials;

/**
 * <p>
 * <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
 * of a work in progress. There is no guarantee that this API will work or that
 * it will remain the same. Please do not use this API without consulting with
 * the egit team.
 * </p>
 *
 * Contains info of a server which hosts git repositories.
 */
public class RepositoryServerInfo {

	private final String label;

	private final URI uri;

	private UserPasswordCredentials credentials;

	/**
	 * @param label
	 *            the human readable label of the repository server to be shown
	 *            in the UI
	 * @param uri
	 *            the URI of the repository server
	 */
	public RepositoryServerInfo(String label, URI uri) {
		this.label = label;
		this.uri = uri;
	}

	/**
	 * @return label the human readable label of the repository server to be
	 *         shown in the UI
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * @return the URI of the repository server which can be used for queries
	 *         for repositories
	 */
	public URI getUri() {
		return uri;
	}

	/**
	 * @param user the user name needed to log in
	 * @param password  the password needed to log in
	 */
	public void setCredentials(String user, String password) {
		credentials = new UserPasswordCredentials(user, password);
	}

	/**
	 * @return the credentials needed to log in
	 */
	public UserPasswordCredentials getCredentials() {
		return credentials;
	}

}

Back to the top