SyncedFolderDisplayItem.java 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Nextcloud Android client application
  3. *
  4. * @author Andy Scherzinger
  5. * Copyright (C) 2016 Andy Scherzinger
  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. import java.util.List;
  23. /**
  24. * Display item specialization for synced folder objects to be displayed in a list/grid view adding further
  25. * information to be displayed in the UI but not part of the persisted underlying {@link SyncedFolder} object.
  26. */
  27. public class SyncedFolderDisplayItem extends SyncedFolder {
  28. private List<String> filePaths;
  29. private String folderName;
  30. private long numberOfFiles;
  31. /**
  32. * constructor for the display item specialization for a synced folder object.
  33. *
  34. * @param id id
  35. * @param localPath local path
  36. * @param remotePath remote path
  37. * @param wifiOnly upload on wifi only flag
  38. * @param chargingOnly upload on charging only
  39. * @param existing also upload existing
  40. * @param subfolderByDate create sub-folders by date (month)
  41. * @param account the account owning the synced folder
  42. * @param uploadAction the action to be done after the upload
  43. * @param enabled flag if synced folder config is active
  44. * @param filePaths the UI info for the file path
  45. * @param folderName the UI info for the folder's name
  46. * @param numberOfFiles the UI info for number of files within the folder
  47. * @param type the type of the folder
  48. * @param hidden hide item flag
  49. */
  50. public SyncedFolderDisplayItem(long id,
  51. String localPath,
  52. String remotePath,
  53. boolean wifiOnly,
  54. boolean chargingOnly,
  55. boolean existing,
  56. boolean subfolderByDate,
  57. String account,
  58. int uploadAction,
  59. boolean enabled,
  60. long timestampMs,
  61. List<String> filePaths,
  62. String folderName,
  63. long numberOfFiles,
  64. MediaFolderType type,
  65. boolean hidden) {
  66. super(id, localPath, remotePath, wifiOnly, chargingOnly, existing, subfolderByDate, account, uploadAction,
  67. enabled, timestampMs, type, hidden);
  68. this.filePaths = filePaths;
  69. this.folderName = folderName;
  70. this.numberOfFiles = numberOfFiles;
  71. }
  72. public SyncedFolderDisplayItem(long id,
  73. String localPath,
  74. String remotePath,
  75. boolean wifiOnly,
  76. boolean chargingOnly,
  77. boolean existing,
  78. boolean subfolderByDate,
  79. String account,
  80. int uploadAction,
  81. boolean enabled,
  82. long timestampMs,
  83. String folderName, MediaFolderType type, boolean hidden) {
  84. super(id, localPath, remotePath, wifiOnly, chargingOnly, existing, subfolderByDate, account, uploadAction,
  85. enabled, timestampMs, type, hidden);
  86. this.folderName = folderName;
  87. }
  88. public List<String> getFilePaths() {
  89. return this.filePaths;
  90. }
  91. public String getFolderName() {
  92. return this.folderName;
  93. }
  94. public long getNumberOfFiles() {
  95. return this.numberOfFiles;
  96. }
  97. public void setFilePaths(List<String> filePaths) {
  98. this.filePaths = filePaths;
  99. }
  100. public void setFolderName(String folderName) {
  101. this.folderName = folderName;
  102. }
  103. public void setNumberOfFiles(long numberOfFiles) {
  104. this.numberOfFiles = numberOfFiles;
  105. }
  106. }