1 /* ownCloud Android client application
2 * Copyright (C) 2012-2014 ownCloud Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package com
.owncloud
.android
.datamodel
;
20 import com
.owncloud
.android
.utils
.Log_OC
;
22 import android
.content
.Context
;
23 import android
.database
.Cursor
;
24 import android
.net
.Uri
;
25 import android
.support
.v4
.content
.CursorLoader
;
28 * CursorLoader for FileList
33 public class FileListCursorLoader
extends CursorLoader
{
35 private static final String TAG
= CursorLoader
.class.getSimpleName();
37 private long mParentId
;
38 private FileDataStorageManager mStorageManager
;
40 public FileListCursorLoader(Context context
) {
42 // TODO Auto-generated constructor stub
45 public FileListCursorLoader(Context context
, Uri uri
, String
[] projection
, String selection
,
46 String
[] selectionArgs
, String sortOrder
) {
47 super(context
, uri
, projection
, selection
, selectionArgs
, sortOrder
);
48 // TODO Auto-generated constructor stub
51 public FileListCursorLoader(Context context
, FileDataStorageManager storageManager
) {
53 mStorageManager
= storageManager
;
56 public void setParentId(long parentId
) {
59 public long getParentId(){
63 public void setStorageManager(FileDataStorageManager storageManager
) {
64 mStorageManager
= storageManager
;
68 public Cursor
loadInBackground() {
69 Log_OC
.d(TAG
, "loadInBackgroud");
71 if (mStorageManager
!= null
) {
72 cursor
= mStorageManager
.getContent(mParentId
);