ProviderMeta.java 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /**
  2. * ownCloud Android client application
  3. *
  4. * @author Bartek Przybylski
  5. * Copyright (C) 2011 Bartek Przybylski
  6. * Copyright (C) 2015 ownCloud Inc.
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. package com.owncloud.android.db;
  22. import android.net.Uri;
  23. import android.provider.BaseColumns;
  24. import com.owncloud.android.MainApp;
  25. /**
  26. * Meta-Class that holds various static field information
  27. */
  28. public class ProviderMeta {
  29. public static final String DB_NAME = "filelist";
  30. public static final int DB_VERSION = 14;
  31. private ProviderMeta() {
  32. }
  33. static public class ProviderTableMeta implements BaseColumns {
  34. public static final String FILE_TABLE_NAME = "filelist";
  35. public static final String OCSHARES_TABLE_NAME = "ocshares";
  36. public static final String CAPABILITIES_TABLE_NAME = "capabilities";
  37. public static final String UPLOADS_TABLE_NAME = "list_of_uploads";
  38. public static final Uri CONTENT_URI = Uri.parse("content://"
  39. + MainApp.getAuthority() + "/");
  40. public static final Uri CONTENT_URI_FILE = Uri.parse("content://"
  41. + MainApp.getAuthority() + "/file");
  42. public static final Uri CONTENT_URI_DIR = Uri.parse("content://"
  43. + MainApp.getAuthority() + "/dir");
  44. public static final Uri CONTENT_URI_SHARE = Uri.parse("content://"
  45. + MainApp.getAuthority() + "/shares");
  46. public static final Uri CONTENT_URI_CAPABILITIES = Uri.parse("content://"
  47. + MainApp.getAuthority() + "/capabilities");
  48. public static final Uri CONTENT_URI_UPLOADS = Uri.parse("content://"
  49. + MainApp.getAuthority() + "/uploads");
  50. public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.owncloud.file";
  51. public static final String CONTENT_TYPE_ITEM = "vnd.android.cursor.item/vnd.owncloud.file";
  52. // Columns of filelist table
  53. public static final String FILE_PARENT = "parent";
  54. public static final String FILE_NAME = "filename";
  55. public static final String FILE_CREATION = "created";
  56. public static final String FILE_MODIFIED = "modified";
  57. public static final String FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA = "modified_at_last_sync_for_data";
  58. public static final String FILE_CONTENT_LENGTH = "content_length";
  59. public static final String FILE_CONTENT_TYPE = "content_type";
  60. public static final String FILE_STORAGE_PATH = "media_path";
  61. public static final String FILE_PATH = "path";
  62. public static final String FILE_ACCOUNT_OWNER = "file_owner";
  63. public static final String FILE_LAST_SYNC_DATE = "last_sync_date";// _for_properties, but let's keep it as it is
  64. public static final String FILE_LAST_SYNC_DATE_FOR_DATA = "last_sync_date_for_data";
  65. public static final String FILE_KEEP_IN_SYNC = "keep_in_sync";
  66. public static final String FILE_ETAG = "etag";
  67. public static final String FILE_SHARED_VIA_LINK = "share_by_link";
  68. public static final String FILE_SHARED_WITH_SHAREE = "shared_via_users";
  69. public static final String FILE_PUBLIC_LINK = "public_link";
  70. public static final String FILE_PERMISSIONS = "permissions";
  71. public static final String FILE_REMOTE_ID = "remote_id";
  72. public static final String FILE_UPDATE_THUMBNAIL = "update_thumbnail";
  73. public static final String FILE_IS_DOWNLOADING= "is_downloading";
  74. public static final String FILE_ETAG_IN_CONFLICT = "etag_in_conflict";
  75. public static final String FILE_DEFAULT_SORT_ORDER = FILE_NAME
  76. + " collate nocase asc";
  77. // Columns of ocshares table
  78. public static final String OCSHARES_FILE_SOURCE = "file_source";
  79. public static final String OCSHARES_ITEM_SOURCE = "item_source";
  80. public static final String OCSHARES_SHARE_TYPE = "share_type";
  81. public static final String OCSHARES_SHARE_WITH = "shate_with";
  82. public static final String OCSHARES_PATH = "path";
  83. public static final String OCSHARES_PERMISSIONS = "permissions";
  84. public static final String OCSHARES_SHARED_DATE = "shared_date";
  85. public static final String OCSHARES_EXPIRATION_DATE = "expiration_date";
  86. public static final String OCSHARES_TOKEN = "token";
  87. public static final String OCSHARES_SHARE_WITH_DISPLAY_NAME = "shared_with_display_name";
  88. public static final String OCSHARES_IS_DIRECTORY = "is_directory";
  89. public static final String OCSHARES_USER_ID = "user_id";
  90. public static final String OCSHARES_ID_REMOTE_SHARED = "id_remote_shared";
  91. public static final String OCSHARES_ACCOUNT_OWNER = "owner_share";
  92. public static final String OCSHARES_DEFAULT_SORT_ORDER = OCSHARES_FILE_SOURCE
  93. + " collate nocase asc";
  94. // Columns of capabilities table
  95. public static final String CAPABILITIES_ACCOUNT_NAME = "account";
  96. public static final String CAPABILITIES_VERSION_MAYOR = "version_mayor";
  97. public static final String CAPABILITIES_VERSION_MINOR = "version_minor";
  98. public static final String CAPABILITIES_VERSION_MICRO = "version_micro";
  99. public static final String CAPABILITIES_VERSION_STRING = "version_string";
  100. public static final String CAPABILITIES_VERSION_EDITION = "version_edition";
  101. public static final String CAPABILITIES_CORE_POLLINTERVAL = "core_pollinterval";
  102. public static final String CAPABILITIES_SHARING_API_ENABLED = "sharing_api_enabled";
  103. public static final String CAPABILITIES_SHARING_PUBLIC_ENABLED = "sharing_public_enabled";
  104. public static final String CAPABILITIES_SHARING_PUBLIC_PASSWORD_ENFORCED = "sharing_public_password_enforced";
  105. public static final String CAPABILITIES_SHARING_PUBLIC_EXPIRE_DATE_ENABLED =
  106. "sharing_public_expire_date_enabled";
  107. public static final String CAPABILITIES_SHARING_PUBLIC_EXPIRE_DATE_DAYS =
  108. "sharing_public_expire_date_days";
  109. public static final String CAPABILITIES_SHARING_PUBLIC_EXPIRE_DATE_ENFORCED =
  110. "sharing_public_expire_date_enforced";
  111. public static final String CAPABILITIES_SHARING_PUBLIC_SEND_MAIL = "sharing_public_send_mail";
  112. public static final String CAPABILITIES_SHARING_PUBLIC_UPLOAD = "sharing_public_upload";
  113. public static final String CAPABILITIES_SHARING_USER_SEND_MAIL = "sharing_user_send_mail";
  114. public static final String CAPABILITIES_SHARING_RESHARING = "sharing_resharing";
  115. public static final String CAPABILITIES_SHARING_FEDERATION_OUTGOING = "sharing_federation_outgoing";
  116. public static final String CAPABILITIES_SHARING_FEDERATION_INCOMING = "sharing_federation_incoming";
  117. public static final String CAPABILITIES_FILES_BIGFILECHUNKING = "files_bigfilechunking";
  118. public static final String CAPABILITIES_FILES_UNDELETE = "files_undelete";
  119. public static final String CAPABILITIES_FILES_VERSIONING = "files_versioning";
  120. public static final String CAPABILITIES_DEFAULT_SORT_ORDER = CAPABILITIES_ACCOUNT_NAME
  121. + " collate nocase asc";
  122. //Columns of Uploads table
  123. public static final String UPLOADS_FILE_ID = "file_id";
  124. public static final String UPLOADS_PATH = "path";
  125. public static final String UPLOADS_STATUS = "status";
  126. public static final String UPLOADS_DEFAULT_SORT_ORDER = UPLOADS_FILE_ID + " collate nocase asc";
  127. }
  128. }