SyncedFolderDisplayItem.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Nextcloud - Android Client
  3. *
  4. * SPDX-FileCopyrightText: 2016 Andy Scherzinger
  5. * SPDX-FileCopyrightText: 2016 Nextcloud
  6. * SPDX-License-Identifier: AGPL-3.0-or-later
  7. */
  8. package com.owncloud.android.datamodel;
  9. import com.nextcloud.client.preferences.SubFolderRule;
  10. import java.util.List;
  11. /**
  12. * Display item specialization for synced folder objects to be displayed in a list/grid view adding further
  13. * information to be displayed in the UI but not part of the persisted underlying {@link SyncedFolder} object.
  14. */
  15. public class SyncedFolderDisplayItem extends SyncedFolder {
  16. private List<String> filePaths;
  17. private String folderName;
  18. private long numberOfFiles;
  19. /**
  20. * constructor for the display item specialization for a synced folder object.
  21. *
  22. * @param id id
  23. * @param localPath local path
  24. * @param remotePath remote path
  25. * @param wifiOnly upload on wifi only flag
  26. * @param chargingOnly upload on charging only
  27. * @param existing also upload existing
  28. * @param subfolderByDate create sub-folders by date (month)
  29. * @param account the account owning the synced folder
  30. * @param uploadAction the action to be done after the upload
  31. * @param enabled flag if synced folder config is active
  32. * @param filePaths the UI info for the file path
  33. * @param folderName the UI info for the folder's name
  34. * @param numberOfFiles the UI info for number of files within the folder
  35. * @param type the type of the folder
  36. * @param hidden hide item flag
  37. * @param subFolderRule whether to filter subFolder by year/month/day
  38. * @param excludeHidden exclude hidden file or folder, for {@link MediaFolderType#CUSTOM} only
  39. */
  40. public SyncedFolderDisplayItem(long id,
  41. String localPath,
  42. String remotePath,
  43. boolean wifiOnly,
  44. boolean chargingOnly,
  45. boolean existing,
  46. boolean subfolderByDate,
  47. String account,
  48. int uploadAction,
  49. int nameCollisionPolicy,
  50. boolean enabled,
  51. long timestampMs,
  52. List<String> filePaths,
  53. String folderName,
  54. long numberOfFiles,
  55. MediaFolderType type,
  56. boolean hidden,
  57. SubFolderRule subFolderRule,
  58. boolean excludeHidden) {
  59. super(id,
  60. localPath,
  61. remotePath,
  62. wifiOnly,
  63. chargingOnly,
  64. existing,
  65. subfolderByDate,
  66. account,
  67. uploadAction,
  68. nameCollisionPolicy,
  69. enabled,
  70. timestampMs,
  71. type,
  72. hidden,
  73. subFolderRule,
  74. excludeHidden);
  75. this.filePaths = filePaths;
  76. this.folderName = folderName;
  77. this.numberOfFiles = numberOfFiles;
  78. }
  79. public SyncedFolderDisplayItem(long id,
  80. String localPath,
  81. String remotePath,
  82. boolean wifiOnly,
  83. boolean chargingOnly,
  84. boolean existing,
  85. boolean subfolderByDate,
  86. String account,
  87. int uploadAction,
  88. int nameCollisionPolicy,
  89. boolean enabled,
  90. long timestampMs,
  91. String folderName,
  92. MediaFolderType type,
  93. boolean hidden,
  94. SubFolderRule subFolderRule,
  95. boolean excludeHidden) {
  96. super(id,
  97. localPath,
  98. remotePath,
  99. wifiOnly,
  100. chargingOnly,
  101. existing,
  102. subfolderByDate,
  103. account,
  104. uploadAction,
  105. nameCollisionPolicy,
  106. enabled,
  107. timestampMs,
  108. type,
  109. hidden,
  110. subFolderRule,
  111. excludeHidden);
  112. this.folderName = folderName;
  113. }
  114. public List<String> getFilePaths() {
  115. return this.filePaths;
  116. }
  117. public String getFolderName() {
  118. return this.folderName;
  119. }
  120. public long getNumberOfFiles() {
  121. return this.numberOfFiles;
  122. }
  123. public void setFilePaths(List<String> filePaths) {
  124. this.filePaths = filePaths;
  125. }
  126. public void setFolderName(String folderName) {
  127. this.folderName = folderName;
  128. }
  129. public void setNumberOfFiles(long numberOfFiles) {
  130. this.numberOfFiles = numberOfFiles;
  131. }
  132. }