public int createTeam() throws IOException {
		File file = new File(repositoryManager.getRobotsDirectory(),
				teamCreatorOptionsPanel.getTeamPackage().replace('.', File.separatorChar)
				+ teamCreatorOptionsPanel.getTeamNameField().getText() + ".team");

		if (file.exists()) {
			int ok = JOptionPane.showConfirmDialog(this, file + " already exists.  Are you sure you want to replace it?",
					"Warning", JOptionPane.YES_NO_CANCEL_OPTION);

			if (ok == JOptionPane.NO_OPTION || ok == JOptionPane.CANCEL_OPTION) {
				return -1;
			}
		}
		if (!file.getParentFile().exists()) {
			if (!file.getParentFile().mkdirs()) {
				Logger.logError("Can't create " + file.getParentFile().toString());
			}
		}

		URL webPageUrl = null;
		String webPageFieldString = teamCreatorOptionsPanel.getWebpageField().getText();

		if (webPageFieldString != null && webPageFieldString.length() > 0) {
			try {
				webPageUrl = new URL(webPageFieldString);
			} catch (MalformedURLException e) {
				try {
					webPageUrl = new URL("http://" + webPageFieldString);
					teamCreatorOptionsPanel.getWebpageField().setText(webPageUrl.toString());
				} catch (MalformedURLException ignored) {}
			}
		}

		String members = robotSelectionPanel.getSelectedRobotsAsString();
		String version = teamCreatorOptionsPanel.getVersionField().getText();
		String author = teamCreatorOptionsPanel.getAuthorField().getText();
		String desc = teamCreatorOptionsPanel.getDescriptionArea().getText();
		
		TeamProperties props = new TeamProperties();
		props.setMembers(members);
		props.setVersion(version);
		props.setAuthor(author);
		props.setDescription(desc);
		props.setWebPage(webPageUrl);

		repositoryManager.createTeam(file, props);
		return 0;
	}