private void fillSettings(CvsRootParser root, Settings settings) { String[] hostAndPort = root.HOST.split(":"); settings.setHost(hostAndPort[0]); if (hostAndPort.length > 1) { settings.setPort(Integer.parseInt(hostAndPort[1])); } else if (root.PORT != null) { try { settings.setPort(Integer.parseInt(root.PORT)); } catch (NumberFormatException e) { settings.setHost(hostAndPort[0]); } } else { settings.setHost(hostAndPort[0]); } String repository = root.REPOSITORY; if (StringUtil.startsWithChar(repository, ':')) repository = repository.substring(1); settings.setRepository(repository); String[] userAndPassword = root.USER_NAME.split(":"); settings.setUser(userAndPassword[0]); if (root.PROXY_HOST != null) { settings.setUseProxy(root.PROXY_HOST, root.PROXY_PORT); } }
private String getPServerConnectionPassword(String cvsRoot, CvsRootParser root) { String[] userAndPassword = root.USER_NAME.split(":"); if (userAndPassword.length > 1) { return PServerPasswordScrambler.getInstance().scramble(userAndPassword[1]); } else { return myBuilder.getPServerPassword(cvsRoot); } }