You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SvnProperties.java 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.core.config;
  21. import java.util.Arrays;
  22. import java.util.List;
  23. import org.sonar.api.CoreProperties;
  24. import org.sonar.api.PropertyType;
  25. import org.sonar.api.config.PropertyDefinition;
  26. import org.sonar.api.resources.Qualifiers;
  27. public class SvnProperties {
  28. private static final String CATEGORY_SVN = "SVN";
  29. public static final String USER_PROP_KEY = "sonar.svn.username";
  30. public static final String PRIVATE_KEY_PATH_PROP_KEY = "sonar.svn.privateKeyPath";
  31. public static final String PASSWORD_PROP_KEY = "sonar.svn.password.secured";
  32. public static final String PASSPHRASE_PROP_KEY = "sonar.svn.passphrase.secured";
  33. private SvnProperties() {
  34. //private only
  35. }
  36. public static List<PropertyDefinition> all() {
  37. return Arrays.asList(
  38. PropertyDefinition.builder(USER_PROP_KEY)
  39. .name("Username")
  40. .description("Username to be used for SVN server or SVN+SSH authentication")
  41. .type(PropertyType.STRING)
  42. .onQualifiers(Qualifiers.PROJECT)
  43. .category(CoreProperties.CATEGORY_SCM)
  44. .subCategory(CATEGORY_SVN)
  45. .index(0)
  46. .build(),
  47. PropertyDefinition.builder(PASSWORD_PROP_KEY)
  48. .name("Password")
  49. .description("Password to be used for SVN server or SVN+SSH authentication")
  50. .type(PropertyType.PASSWORD)
  51. .onQualifiers(Qualifiers.PROJECT)
  52. .category(CoreProperties.CATEGORY_SCM)
  53. .subCategory(CATEGORY_SVN)
  54. .index(1)
  55. .build(),
  56. PropertyDefinition.builder(PRIVATE_KEY_PATH_PROP_KEY)
  57. .name("Path to private key file")
  58. .description("Can be used instead of password for SVN+SSH authentication")
  59. .type(PropertyType.STRING)
  60. .onQualifiers(Qualifiers.PROJECT)
  61. .category(CoreProperties.CATEGORY_SCM)
  62. .subCategory(CATEGORY_SVN)
  63. .index(2)
  64. .build(),
  65. PropertyDefinition.builder(PASSPHRASE_PROP_KEY)
  66. .name("Passphrase")
  67. .description("Optional passphrase of your private key file")
  68. .type(PropertyType.PASSWORD)
  69. .onQualifiers(Qualifiers.PROJECT)
  70. .category(CoreProperties.CATEGORY_SCM)
  71. .subCategory(CATEGORY_SVN)
  72. .index(3)
  73. .build());
  74. }
  75. }