SyncedFolder.java 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /**
  2. * Nextcloud Android client application
  3. *
  4. * @author Tobias Kaminsky
  5. * Copyright (C) 2016 Tobias Kaminsky
  6. * Copyright (C) 2016 Nextcloud
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. package com.owncloud.android.datamodel;
  22. /**
  23. * Synced folder entity containing all information per synced folder.
  24. */
  25. public class SyncedFolder {
  26. public static final long UNPERSISTED_ID = Long.MIN_VALUE;
  27. private long id = UNPERSISTED_ID;
  28. private String localPath;
  29. private String remotePath;
  30. private Boolean wifiOnly;
  31. private Boolean chargingOnly;
  32. private Boolean subfolderByDate;
  33. private String account;
  34. private Integer uploadAction;
  35. private boolean enabled;
  36. /**
  37. * constructor for already persisted entity.
  38. *
  39. * @param id the primary key
  40. * @param localPath local path
  41. * @param remotePath remote path
  42. * @param wifiOnly upload on wifi only flag
  43. * @param chargingOnly upload on charging only
  44. * @param subfolderByDate create sub-folders by date (month)
  45. * @param account the account owning the synced folder
  46. * @param uploadAction the action to be done after the upload
  47. * @param enabled flag if synced folder config is active
  48. */
  49. public SyncedFolder(long id, String localPath, String remotePath, Boolean wifiOnly, Boolean chargingOnly,
  50. Boolean subfolderByDate, String account, Integer uploadAction, Boolean enabled) {
  51. this.id = id;
  52. this.localPath = localPath;
  53. this.remotePath = remotePath;
  54. this.wifiOnly = wifiOnly;
  55. this.chargingOnly = chargingOnly;
  56. this.subfolderByDate = subfolderByDate;
  57. this.account = account;
  58. this.uploadAction = uploadAction;
  59. this.enabled = enabled;
  60. }
  61. /**
  62. * constructor for new, to be persisted entity.
  63. *
  64. * @param localPath local path
  65. * @param remotePath remote path
  66. * @param wifiOnly upload on wifi only flag
  67. * @param chargingOnly upload on charging only
  68. * @param subfolderByDate create sub-folders by date (month)
  69. * @param account the account owning the synced folder
  70. * @param uploadAction the action to be done after the upload
  71. * @param enabled flag if synced folder config is active
  72. */
  73. public SyncedFolder(String localPath, String remotePath, Boolean wifiOnly, Boolean chargingOnly,
  74. Boolean subfolderByDate, String account, Integer uploadAction, Boolean enabled) {
  75. this.localPath = localPath;
  76. this.remotePath = remotePath;
  77. this.wifiOnly = wifiOnly;
  78. this.chargingOnly = chargingOnly;
  79. this.subfolderByDate = subfolderByDate;
  80. this.account = account;
  81. this.uploadAction = uploadAction;
  82. this.enabled = enabled;
  83. }
  84. public long getId() {
  85. return id;
  86. }
  87. public void setId(long id) {
  88. this.id = id;
  89. }
  90. public String getLocalPath() {
  91. return localPath;
  92. }
  93. public void setLocalPath(String localPath) {
  94. this.localPath = localPath;
  95. }
  96. public String getRemotePath() {
  97. return remotePath;
  98. }
  99. public void setRemotePath(String remotePath) {
  100. this.remotePath = remotePath;
  101. }
  102. public Boolean getWifiOnly() {
  103. return wifiOnly;
  104. }
  105. public void setWifiOnly(Boolean wifiOnly) {
  106. this.wifiOnly = wifiOnly;
  107. }
  108. public Boolean getChargingOnly() {
  109. return chargingOnly;
  110. }
  111. public void setChargingOnly(Boolean chargingOnly) {
  112. this.chargingOnly = chargingOnly;
  113. }
  114. public Boolean getSubfolderByDate() {
  115. return subfolderByDate;
  116. }
  117. public void setSubfolderByDate(Boolean subfolderByDate) {
  118. this.subfolderByDate = subfolderByDate;
  119. }
  120. public String getAccount() {
  121. return account;
  122. }
  123. public void setAccount(String account) {
  124. this.account = account;
  125. }
  126. public Integer getUploadAction() {
  127. return uploadAction;
  128. }
  129. public void setUploadAction(Integer uploadAction) {
  130. this.uploadAction = uploadAction;
  131. }
  132. public boolean isEnabled() {
  133. return enabled;
  134. }
  135. public void setEnabled(boolean enabled) {
  136. this.enabled = enabled;
  137. }
  138. }