/plugins/SVNPlugin/trunk/src/ise/plugin/svn/data/RepositoryData.java

# · Java · 79 lines · 32 code · 9 blank · 38 comment · 5 complexity · bca4ed2ef1c06819a5b37b3b061f1c19 MD5 · raw file

  1. /*
  2. Copyright (c) 2007, Dale Anson
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without modification,
  5. are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright notice,
  7. this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright notice,
  9. this list of conditions and the following disclaimer in the documentation
  10. and/or other materials provided with the distribution.
  11. * Neither the name of the author nor the names of its contributors
  12. may be used to endorse or promote products derived from this software without
  13. specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  18. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. package ise.plugin.svn.data;
  26. /**
  27. * Data object for information about a repository: a name for the repository,
  28. * url for the repository, and username/password to connect to the repository.
  29. */
  30. public class RepositoryData extends CheckoutData {
  31. private String name = "";
  32. public RepositoryData() {}
  33. public RepositoryData( String name, String url,
  34. String username,
  35. String password ) {
  36. super();
  37. this.name = name;
  38. setURL( url );
  39. setUsername( username );
  40. setPassword( password );
  41. }
  42. public RepositoryData(RepositoryData data) {
  43. super();
  44. if (data != null) {
  45. name = data.getName() == null ? "" : data.getName();
  46. setURL(new String(data.getURL()));
  47. setUsername(data.getUsername() == null ? null : new String(data.getUsername()));
  48. setPassword(data.getPassword() == null ? null : new String(data.getPassword()));
  49. }
  50. }
  51. public String toString() {
  52. return "RepositoryData[name=" + getName() + ", url=" + getURL() + ", username=" + getUsername() + ", password=" + getPassword() + "]";
  53. }
  54. /**
  55. * Returns the value of the name of the repository.
  56. */
  57. public String getName() {
  58. return name;
  59. }
  60. /**
  61. * Sets the value of name.
  62. * @param name a name for this repository.
  63. */
  64. public void setName( String name ) {
  65. this.name = name;
  66. }
  67. }