OCFile.java 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. /*
  2. * ownCloud Android client application
  3. *
  4. * @author Bartek Przybylski
  5. * @author David A. Velasco
  6. * Copyright (C) 2012 Bartek Przybylski
  7. * Copyright (C) 2016 ownCloud Inc.
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2,
  11. * as published by the Free Software Foundation.
  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 General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. package com.owncloud.android.datamodel;
  23. import android.content.ContentResolver;
  24. import android.content.Context;
  25. import android.net.Uri;
  26. import android.os.Parcel;
  27. import android.os.Parcelable;
  28. import android.text.TextUtils;
  29. import com.owncloud.android.R;
  30. import com.owncloud.android.lib.common.network.WebdavEntry;
  31. import com.owncloud.android.lib.common.network.WebdavUtils;
  32. import com.owncloud.android.lib.common.utils.Log_OC;
  33. import com.owncloud.android.lib.resources.files.model.ServerFileInterface;
  34. import com.owncloud.android.lib.resources.shares.ShareeUser;
  35. import com.owncloud.android.utils.MimeType;
  36. import java.io.File;
  37. import java.util.List;
  38. import androidx.annotation.NonNull;
  39. import androidx.annotation.VisibleForTesting;
  40. import androidx.core.content.FileProvider;
  41. import third_parties.daveKoeller.AlphanumComparator;
  42. public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterface {
  43. private final static String PERMISSION_SHARED_WITH_ME = "S";
  44. private final static String PERMISSION_CAN_RESHARE = "R";
  45. private final static String PERMISSION_CAN_WRITE = "CK";
  46. public static final String PATH_SEPARATOR = "/";
  47. public static final String ROOT_PATH = PATH_SEPARATOR;
  48. private static final String TAG = OCFile.class.getSimpleName();
  49. private long fileId; // android internal ID of the file
  50. private long parentId;
  51. private long fileLength;
  52. private long creationTimestamp; // UNIX timestamp of the time the file was created
  53. private long modificationTimestamp; // UNIX timestamp of the file modification time
  54. /** UNIX timestamp of the modification time, corresponding to the value returned by the server
  55. * in the last synchronization of THE CONTENTS of this file.
  56. */
  57. private long modificationTimestampAtLastSyncForData;
  58. private String remotePath;
  59. private String decryptedRemotePath;
  60. private String localPath;
  61. private String mimeType;
  62. private boolean needsUpdatingWhileSaving;
  63. private long lastSyncDateForProperties;
  64. private long lastSyncDateForData;
  65. private boolean previewAvailable;
  66. private String etag;
  67. private String etagOnServer;
  68. private boolean sharedViaLink;
  69. private String publicLink;
  70. private String permissions;
  71. private String remoteId; // The fileid namespaced by the instance fileId, globally unique
  72. private boolean updateThumbnailNeeded;
  73. private boolean downloading;
  74. private String etagInConflict; // Only saves file etag in the server, when there is a conflict
  75. private boolean sharedWithSharee;
  76. private boolean favorite;
  77. private boolean encrypted;
  78. private WebdavEntry.MountType mountType;
  79. private int unreadCommentsCount;
  80. private String ownerId;
  81. private String ownerDisplayName;
  82. String note;
  83. private List<ShareeUser> sharees;
  84. private String richWorkspace;
  85. /**
  86. * URI to the local path of the file contents, if stored in the device; cached after first call
  87. * to {@link #getStorageUri()}
  88. */
  89. private Uri localUri;
  90. /**
  91. * Exportable URI to the local path of the file contents, if stored in the device.
  92. * <p>
  93. * Cached after first call, until changed.
  94. */
  95. private Uri exposedFileUri;
  96. /**
  97. * Create new {@link OCFile} with given path.
  98. * <p>
  99. * The path received must be URL-decoded. Path separator must be OCFile.PATH_SEPARATOR, and it must be the first character in 'path'.
  100. *
  101. * @param path The remote path of the file.
  102. */
  103. public OCFile(String path) {
  104. resetData();
  105. needsUpdatingWhileSaving = false;
  106. if (TextUtils.isEmpty(path) || !path.startsWith(PATH_SEPARATOR)) {
  107. throw new IllegalArgumentException("Trying to create a OCFile with a non valid remote path: " + path);
  108. }
  109. remotePath = path;
  110. }
  111. @VisibleForTesting
  112. public OCFile(String path, String remoteId) {
  113. this(path);
  114. this.remoteId = remoteId;
  115. }
  116. /**
  117. * Reconstruct from parcel
  118. *
  119. * @param source The source parcel
  120. */
  121. private OCFile(Parcel source) {
  122. fileId = source.readLong();
  123. parentId = source.readLong();
  124. fileLength = source.readLong();
  125. creationTimestamp = source.readLong();
  126. modificationTimestamp = source.readLong();
  127. modificationTimestampAtLastSyncForData = source.readLong();
  128. remotePath = source.readString();
  129. decryptedRemotePath = source.readString();
  130. localPath = source.readString();
  131. mimeType = source.readString();
  132. needsUpdatingWhileSaving = source.readInt() == 0;
  133. lastSyncDateForProperties = source.readLong();
  134. lastSyncDateForData = source.readLong();
  135. etag = source.readString();
  136. etagOnServer = source.readString();
  137. sharedViaLink = source.readInt() == 1;
  138. publicLink = source.readString();
  139. permissions = source.readString();
  140. remoteId = source.readString();
  141. updateThumbnailNeeded = source.readInt() == 1;
  142. downloading = source.readInt() == 1;
  143. etagInConflict = source.readString();
  144. sharedWithSharee = source.readInt() == 1;
  145. favorite = source.readInt() == 1;
  146. encrypted = source.readInt() == 1;
  147. ownerId = source.readString();
  148. ownerDisplayName = source.readString();
  149. mountType = (WebdavEntry.MountType) source.readSerializable();
  150. richWorkspace = source.readString();
  151. previewAvailable = source.readInt() == 1;
  152. }
  153. @Override
  154. public void writeToParcel(Parcel dest, int flags) {
  155. dest.writeLong(fileId);
  156. dest.writeLong(parentId);
  157. dest.writeLong(fileLength);
  158. dest.writeLong(creationTimestamp);
  159. dest.writeLong(modificationTimestamp);
  160. dest.writeLong(modificationTimestampAtLastSyncForData);
  161. dest.writeString(remotePath);
  162. dest.writeString(decryptedRemotePath);
  163. dest.writeString(localPath);
  164. dest.writeString(mimeType);
  165. dest.writeInt(needsUpdatingWhileSaving ? 1 : 0);
  166. dest.writeLong(lastSyncDateForProperties);
  167. dest.writeLong(lastSyncDateForData);
  168. dest.writeString(etag);
  169. dest.writeString(etagOnServer);
  170. dest.writeInt(sharedViaLink ? 1 : 0);
  171. dest.writeString(publicLink);
  172. dest.writeString(permissions);
  173. dest.writeString(remoteId);
  174. dest.writeInt(updateThumbnailNeeded ? 1 : 0);
  175. dest.writeInt(downloading ? 1 : 0);
  176. dest.writeString(etagInConflict);
  177. dest.writeInt(sharedWithSharee ? 1 : 0);
  178. dest.writeInt(favorite ? 1 : 0);
  179. dest.writeInt(encrypted ? 1 : 0);
  180. dest.writeString(ownerId);
  181. dest.writeString(ownerDisplayName);
  182. dest.writeSerializable(mountType);
  183. dest.writeString(richWorkspace);
  184. dest.writeInt(previewAvailable ? 1 : 0);
  185. }
  186. public void setDecryptedRemotePath(String path) {
  187. decryptedRemotePath = path;
  188. }
  189. /**
  190. * Use decrypted remote path for every local file operation Use encrypted remote path for every dav related
  191. * operation
  192. */
  193. public String getDecryptedRemotePath() {
  194. // Fallback
  195. // TODO test without, on a new created folder
  196. if (!isEncrypted() && decryptedRemotePath == null) {
  197. decryptedRemotePath = remotePath;
  198. }
  199. if (isFolder()) {
  200. if (decryptedRemotePath.endsWith(PATH_SEPARATOR)) {
  201. return decryptedRemotePath;
  202. } else {
  203. return decryptedRemotePath + PATH_SEPARATOR;
  204. }
  205. } else {
  206. if (decryptedRemotePath == null) {
  207. // last fallback
  208. return remotePath;
  209. } else {
  210. return decryptedRemotePath;
  211. }
  212. }
  213. }
  214. /**
  215. * Returns the remote path of the file on Nextcloud
  216. * (this might be an encrypted file path, if E2E is used)
  217. * <p>
  218. * Use decrypted remote path for every local file operation.
  219. * Use remote path for every dav related operation
  220. *
  221. * @return The remote path to the file
  222. */
  223. public String getRemotePath() {
  224. if (isFolder()) {
  225. if (remotePath.endsWith(PATH_SEPARATOR)) {
  226. return remotePath;
  227. } else {
  228. return remotePath + PATH_SEPARATOR;
  229. }
  230. } else {
  231. return remotePath;
  232. }
  233. }
  234. /**
  235. * Can be used to check, whether or not this file exists in the database
  236. * already
  237. *
  238. * @return true, if the file exists in the database
  239. */
  240. public boolean fileExists() {
  241. return fileId != -1;
  242. }
  243. /**
  244. * Use this to find out if this file is a folder.
  245. *
  246. * @return true if it is a folder
  247. */
  248. public boolean isFolder() {
  249. return MimeType.DIRECTORY.equals(mimeType) || MimeType.WEBDAV_FOLDER.equals(mimeType);
  250. }
  251. /**
  252. * Sets mimetype to folder and returns this file
  253. * Only for testing
  254. *
  255. * @return OCFile this file
  256. */
  257. public OCFile setFolder() {
  258. setMimeType(MimeType.DIRECTORY);
  259. return this;
  260. }
  261. /**
  262. * Use this to check if this file is available locally
  263. *
  264. * @return true if it is
  265. */
  266. public boolean isDown() {
  267. return !isFolder() && existsOnDevice();
  268. }
  269. /**
  270. * Use this to check if this file or folder is available locally
  271. *
  272. * @return true if it is
  273. */
  274. public boolean existsOnDevice() {
  275. if (!TextUtils.isEmpty(localPath)) {
  276. return new File(localPath).exists();
  277. }
  278. return false;
  279. }
  280. /**
  281. * The path, where the file is stored locally
  282. *
  283. * @return The local path to the file
  284. */
  285. public String getStoragePath() {
  286. return localPath;
  287. }
  288. /**
  289. * The URI to the file contents, if stored locally
  290. *
  291. * @return A URI to the local copy of the file, or NULL if not stored in the device
  292. */
  293. public Uri getStorageUri() {
  294. if (TextUtils.isEmpty(localPath)) {
  295. return null;
  296. }
  297. if (localUri == null) {
  298. Uri.Builder builder = new Uri.Builder();
  299. builder.scheme(ContentResolver.SCHEME_FILE);
  300. builder.path(localPath);
  301. localUri = builder.build();
  302. }
  303. return localUri;
  304. }
  305. public Uri getLegacyExposedFileUri() {
  306. if (TextUtils.isEmpty(localPath)) {
  307. return null;
  308. }
  309. if (exposedFileUri == null) {
  310. return Uri.parse(ContentResolver.SCHEME_FILE + "://" + WebdavUtils.encodePath(localPath));
  311. }
  312. return exposedFileUri;
  313. }
  314. /*
  315. Partly disabled because not all apps understand paths that we get via this method for now
  316. */
  317. public Uri getExposedFileUri(Context context) {
  318. if (TextUtils.isEmpty(localPath)) {
  319. return null;
  320. }
  321. if (exposedFileUri == null) {
  322. try {
  323. exposedFileUri = FileProvider.getUriForFile(
  324. context,
  325. context.getString(R.string.file_provider_authority),
  326. new File(localPath));
  327. } catch (IllegalArgumentException ex) {
  328. // Could not share file using FileProvider URI scheme.
  329. // Fall back to legacy URI parsing.
  330. getLegacyExposedFileUri();
  331. }
  332. }
  333. return exposedFileUri;
  334. }
  335. /**
  336. * Can be used to set the path where the file is stored
  337. *
  338. * @param storage_path to set
  339. */
  340. public void setStoragePath(String storage_path) {
  341. if (storage_path == null) {
  342. localPath = null;
  343. } else {
  344. localPath = storage_path.replaceAll("//", "/");
  345. }
  346. localUri = null;
  347. exposedFileUri = null;
  348. }
  349. /**
  350. * Returns the decrypted filename and "/" for the root directory
  351. *
  352. * @return The name of the file
  353. */
  354. public String getFileName() {
  355. return getDecryptedFileName();
  356. }
  357. /**
  358. * Returns the decrypted filename and "/" for the root directory
  359. *
  360. * @return The name of the file
  361. */
  362. public String getDecryptedFileName() {
  363. File f = new File(getDecryptedRemotePath());
  364. return f.getName().length() == 0 ? ROOT_PATH : f.getName();
  365. }
  366. /**
  367. * Returns the encrypted filename and "/" for the root directory
  368. *
  369. * @return The name of the file
  370. */
  371. public String getEncryptedFileName() {
  372. File f = new File(remotePath);
  373. return f.getName().length() == 0 ? ROOT_PATH : f.getName();
  374. }
  375. /**
  376. * Sets the name of the file
  377. * <p/>
  378. * Does nothing if the new name is null, empty or includes "/" ; or if the file is the root
  379. * directory
  380. */
  381. public void setFileName(String name) {
  382. Log_OC.d(TAG, "OCFile name changing from " + remotePath);
  383. if (!TextUtils.isEmpty(name) && !name.contains(PATH_SEPARATOR) && !ROOT_PATH.equals(remotePath)) {
  384. String parent = new File(this.getRemotePath()).getParent();
  385. parent = parent.endsWith(PATH_SEPARATOR) ? parent : parent + PATH_SEPARATOR;
  386. remotePath = parent + name;
  387. if (isFolder()) {
  388. remotePath += PATH_SEPARATOR;
  389. }
  390. Log_OC.d(TAG, "OCFile name changed to " + remotePath);
  391. }
  392. }
  393. /**
  394. * Used internally. Reset all file properties
  395. */
  396. private void resetData() {
  397. fileId = -1;
  398. remotePath = null;
  399. decryptedRemotePath = null;
  400. parentId = 0;
  401. localPath = null;
  402. mimeType = null;
  403. fileLength = 0;
  404. creationTimestamp = 0;
  405. modificationTimestamp = 0;
  406. modificationTimestampAtLastSyncForData = 0;
  407. lastSyncDateForProperties = 0;
  408. lastSyncDateForData = 0;
  409. needsUpdatingWhileSaving = false;
  410. etag = null;
  411. etagOnServer = null;
  412. sharedViaLink = false;
  413. publicLink = null;
  414. permissions = null;
  415. remoteId = null;
  416. updateThumbnailNeeded = false;
  417. downloading = false;
  418. etagInConflict = null;
  419. sharedWithSharee = false;
  420. favorite = false;
  421. encrypted = false;
  422. mountType = WebdavEntry.MountType.INTERNAL;
  423. richWorkspace = "";
  424. }
  425. /**
  426. * get remote path of parent file
  427. *
  428. * @return remote path
  429. */
  430. public String getParentRemotePath() {
  431. String parentPath = new File(this.getRemotePath()).getParent();
  432. return parentPath.endsWith(PATH_SEPARATOR) ? parentPath : parentPath + PATH_SEPARATOR;
  433. }
  434. @Override
  435. public int describeContents() {
  436. return super.hashCode();
  437. }
  438. @Override
  439. public int compareTo(@NonNull OCFile another) {
  440. if (isFolder() && another.isFolder()) {
  441. return new AlphanumComparator().compare(this, another);
  442. } else if (isFolder()) {
  443. return -1;
  444. } else if (another.isFolder()) {
  445. return 1;
  446. }
  447. return new AlphanumComparator().compare(this, another);
  448. }
  449. @Override
  450. public boolean equals(Object o) {
  451. if (this == o) {
  452. return true;
  453. }
  454. if (o == null || getClass() != o.getClass()) {
  455. return false;
  456. }
  457. OCFile ocFile = (OCFile) o;
  458. return fileId == ocFile.fileId && parentId == ocFile.parentId;
  459. }
  460. @Override
  461. public int hashCode() {
  462. return 31 * (int) (fileId ^ (fileId >>> 32)) + (int) (parentId ^ (parentId >>> 32));
  463. }
  464. @NonNull
  465. @Override
  466. public String toString() {
  467. String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, " +
  468. "parentId=%s, etag=%s, favourite=%s]";
  469. return String.format(asString,
  470. fileId,
  471. getFileName(),
  472. mimeType,
  473. isDown(),
  474. localPath,
  475. remotePath,
  476. parentId,
  477. etag,
  478. favorite);
  479. }
  480. public void setEtag(String etag) {
  481. this.etag = etag != null ? etag : "";
  482. }
  483. public void setEtagOnServer(String etag) {
  484. this.etagOnServer = etag != null ? etag : "";
  485. }
  486. public long getLocalModificationTimestamp() {
  487. if (!TextUtils.isEmpty(localPath)) {
  488. File f = new File(localPath);
  489. return f.lastModified();
  490. }
  491. return 0;
  492. }
  493. /**
  494. * @return 'True' if the file is hidden
  495. */
  496. public boolean isHidden() {
  497. return !TextUtils.isEmpty(getFileName()) && getFileName().charAt(0) == '.';
  498. }
  499. /**
  500. * The unique fileId for the file within the instance
  501. *
  502. * @return file fileId, unique within the instance
  503. */
  504. public String getLocalId() {
  505. return getRemoteId().substring(0, 8).replaceAll("^0*", "");
  506. }
  507. public boolean isInConflict() {
  508. return !TextUtils.isEmpty(etagInConflict);
  509. }
  510. public boolean isSharedWithMe() {
  511. String permissions = getPermissions();
  512. return permissions != null && permissions.contains(PERMISSION_SHARED_WITH_ME);
  513. }
  514. public boolean canReshare() {
  515. String permissions = getPermissions();
  516. return permissions != null && permissions.contains(PERMISSION_CAN_RESHARE);
  517. }
  518. public boolean canWrite() {
  519. String permissions = getPermissions();
  520. return permissions != null && permissions.contains(PERMISSION_CAN_WRITE);
  521. }
  522. public static final Parcelable.Creator<OCFile> CREATOR = new Parcelable.Creator<OCFile>() {
  523. @Override
  524. public OCFile createFromParcel(Parcel source) {
  525. return new OCFile(source);
  526. }
  527. @Override
  528. public OCFile[] newArray(int size) {
  529. return new OCFile[size];
  530. }
  531. };
  532. public long getFileId() {
  533. return this.fileId;
  534. }
  535. public long getParentId() {
  536. return this.parentId;
  537. }
  538. public long getFileLength() {
  539. return this.fileLength;
  540. }
  541. public long getCreationTimestamp() {
  542. return this.creationTimestamp;
  543. }
  544. public long getModificationTimestamp() {
  545. return this.modificationTimestamp;
  546. }
  547. public long getModificationTimestampAtLastSyncForData() {
  548. return this.modificationTimestampAtLastSyncForData;
  549. }
  550. public String getMimeType() {
  551. return this.mimeType;
  552. }
  553. public boolean isNeedsUpdatingWhileSaving() {
  554. return this.needsUpdatingWhileSaving;
  555. }
  556. public long getLastSyncDateForProperties() {
  557. return this.lastSyncDateForProperties;
  558. }
  559. public long getLastSyncDateForData() {
  560. return this.lastSyncDateForData;
  561. }
  562. public boolean isPreviewAvailable() {
  563. return this.previewAvailable;
  564. }
  565. public String getEtag() {
  566. return this.etag;
  567. }
  568. public String getEtagOnServer() {
  569. return this.etagOnServer;
  570. }
  571. public boolean isSharedViaLink() {
  572. return this.sharedViaLink;
  573. }
  574. public String getPublicLink() {
  575. return this.publicLink;
  576. }
  577. public String getPermissions() {
  578. return this.permissions;
  579. }
  580. public String getRemoteId() {
  581. return this.remoteId;
  582. }
  583. public boolean isUpdateThumbnailNeeded() {
  584. return this.updateThumbnailNeeded;
  585. }
  586. public boolean isDownloading() {
  587. return this.downloading;
  588. }
  589. public String getEtagInConflict() {
  590. return this.etagInConflict;
  591. }
  592. public boolean isSharedWithSharee() {
  593. return this.sharedWithSharee;
  594. }
  595. public boolean isFavorite() {
  596. return this.favorite;
  597. }
  598. public boolean isEncrypted() {
  599. return this.encrypted;
  600. }
  601. public WebdavEntry.MountType getMountType() {
  602. return this.mountType;
  603. }
  604. public int getUnreadCommentsCount() {
  605. return this.unreadCommentsCount;
  606. }
  607. public String getOwnerId() {
  608. return this.ownerId;
  609. }
  610. public String getOwnerDisplayName() {
  611. return this.ownerDisplayName;
  612. }
  613. public String getNote() {
  614. return this.note;
  615. }
  616. public List<ShareeUser> getSharees() {
  617. return this.sharees;
  618. }
  619. public String getRichWorkspace() {
  620. return this.richWorkspace;
  621. }
  622. public void setFileId(long fileId) {
  623. this.fileId = fileId;
  624. }
  625. public void setParentId(long parentId) {
  626. this.parentId = parentId;
  627. }
  628. public void setFileLength(long fileLength) {
  629. this.fileLength = fileLength;
  630. }
  631. public void setCreationTimestamp(long creationTimestamp) {
  632. this.creationTimestamp = creationTimestamp;
  633. }
  634. public void setModificationTimestamp(long modificationTimestamp) {
  635. this.modificationTimestamp = modificationTimestamp;
  636. }
  637. public void setModificationTimestampAtLastSyncForData(long modificationTimestampAtLastSyncForData) {
  638. this.modificationTimestampAtLastSyncForData = modificationTimestampAtLastSyncForData;
  639. }
  640. public void setRemotePath(String remotePath) {
  641. this.remotePath = remotePath;
  642. }
  643. public void setMimeType(String mimeType) {
  644. this.mimeType = mimeType;
  645. }
  646. public void setLastSyncDateForProperties(long lastSyncDateForProperties) {
  647. this.lastSyncDateForProperties = lastSyncDateForProperties;
  648. }
  649. public void setLastSyncDateForData(long lastSyncDateForData) {
  650. this.lastSyncDateForData = lastSyncDateForData;
  651. }
  652. public void setPreviewAvailable(boolean previewAvailable) {
  653. this.previewAvailable = previewAvailable;
  654. }
  655. public void setSharedViaLink(boolean sharedViaLink) {
  656. this.sharedViaLink = sharedViaLink;
  657. }
  658. public void setPublicLink(String publicLink) {
  659. this.publicLink = publicLink;
  660. }
  661. public void setPermissions(String permissions) {
  662. this.permissions = permissions;
  663. }
  664. public void setRemoteId(String remoteId) {
  665. this.remoteId = remoteId;
  666. }
  667. public void setUpdateThumbnailNeeded(boolean updateThumbnailNeeded) {
  668. this.updateThumbnailNeeded = updateThumbnailNeeded;
  669. }
  670. public void setDownloading(boolean downloading) {
  671. this.downloading = downloading;
  672. }
  673. public void setEtagInConflict(String etagInConflict) {
  674. this.etagInConflict = etagInConflict;
  675. }
  676. public void setSharedWithSharee(boolean sharedWithSharee) {
  677. this.sharedWithSharee = sharedWithSharee;
  678. }
  679. public void setFavorite(boolean favorite) {
  680. this.favorite = favorite;
  681. }
  682. public void setEncrypted(boolean encrypted) {
  683. this.encrypted = encrypted;
  684. }
  685. public void setMountType(WebdavEntry.MountType mountType) {
  686. this.mountType = mountType;
  687. }
  688. public void setUnreadCommentsCount(int unreadCommentsCount) {
  689. this.unreadCommentsCount = unreadCommentsCount;
  690. }
  691. public void setOwnerId(String ownerId) {
  692. this.ownerId = ownerId;
  693. }
  694. public void setOwnerDisplayName(String ownerDisplayName) {
  695. this.ownerDisplayName = ownerDisplayName;
  696. }
  697. public void setNote(String note) {
  698. this.note = note;
  699. }
  700. public void setSharees(List<ShareeUser> sharees) {
  701. this.sharees = sharees;
  702. }
  703. public void setRichWorkspace(String richWorkspace) {
  704. this.richWorkspace = richWorkspace;
  705. }
  706. }