|
6 | 6 | import javax.inject.Inject; |
7 | 7 |
|
8 | 8 | import org.backmeup.index.ActiveUsers; |
| 9 | +import org.backmeup.index.api.IndexFields; |
9 | 10 | import org.backmeup.index.dal.UserMappingHelperDao; |
10 | 11 | import org.backmeup.index.model.IndexDocument; |
11 | 12 | import org.backmeup.index.utils.file.UserMappingHelper; |
@@ -48,11 +49,11 @@ private boolean isBackmeupSinkStorage(IndexDocument doc) { |
48 | 49 | public void addStorageFileAccessRights(Long fromUserId, Long withUserId, IndexDocument doc) throws IOException { |
49 | 50 | //check if we're using backmeup storage as sink |
50 | 51 | if (isBackmeupSinkStorage(doc)) { |
51 | | - String filePath = doc.getFields().get("path").toString(); |
| 52 | + String filePath = doc.getFields().get(IndexFields.FIELD_PATH).toString(); |
52 | 53 | String filePathThumbnail = null; |
53 | 54 | //check if there is a thumbnail attached |
54 | | - if (doc.getFields().get("thumbnail_path") != null) { |
55 | | - filePathThumbnail = doc.getFields().get("thumbnail_path").toString(); |
| 55 | + if (doc.getLargeFields().get(IndexFields.FIELD_THUMBNAIL_PATH) != null) { |
| 56 | + filePathThumbnail = doc.getLargeFields().get(IndexFields.FIELD_THUMBNAIL_PATH).toString(); |
56 | 57 | } |
57 | 58 |
|
58 | 59 | //check existing file access rights on storage for user and sharing partner |
@@ -155,11 +156,11 @@ private boolean hasStorageFileAccessRight(Long fromUserId, Long withUserId, Stri |
155 | 156 | public void removeStorageFileAccessRights(Long fromUserId, Long withUserId, IndexDocument doc) throws IOException { |
156 | 157 | //check if we're using backmeup storage as sink |
157 | 158 | if (isBackmeupSinkStorage(doc)) { |
158 | | - String filePath = doc.getFields().get("path").toString(); |
| 159 | + String filePath = doc.getFields().get(IndexFields.FIELD_PATH).toString(); |
159 | 160 | String filePathThumbnail = null; |
160 | 161 | //check if there is a thumbnail attached |
161 | | - if (doc.getFields().get("thumbnail_path") != null) { |
162 | | - filePathThumbnail = doc.getFields().get("thumbnail_path").toString(); |
| 162 | + if (doc.getLargeFields().get(IndexFields.FIELD_THUMBNAIL_PATH) != null) { |
| 163 | + filePathThumbnail = doc.getLargeFields().get(IndexFields.FIELD_THUMBNAIL_PATH).toString(); |
163 | 164 | } |
164 | 165 | //check existing file access rights on storage for user and sharing partner |
165 | 166 | boolean bAccessWithUser = withUserHasStorageFileAccessRight(fromUserId, withUserId, filePath); |
|
0 commit comments