33
33
import android .content .SyncResult ;
34
34
import android .content .IntentSender .SendIntentException ;
35
35
import android .os .Bundle ;
36
+ import android .util .Log ;
36
37
import eu .alefzero .owncloud .datamodel .FileDataStorageManager ;
37
38
import eu .alefzero .owncloud .datamodel .OCFile ;
38
39
import eu .alefzero .webdav .WebdavEntry ;
45
46
*/
46
47
public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
47
48
48
- public static final String SYNC_MESSAGE = "eu.alefzero.owncloud.files.ACCOUNT_SYNC" ;
49
- public static final String IN_PROGRESS = "sync_in_progress" ;
50
- public static final String ACCOUNT_NAME = "account_name" ;
51
-
52
49
public FileSyncAdapter (Context context , boolean autoInitialize ) {
53
50
super (context , autoInitialize );
54
51
}
@@ -65,17 +62,19 @@ public synchronized void onPerformSync(
65
62
this .setContentProvider (provider );
66
63
this .setStorageManager (new FileDataStorageManager (account , getContentProvider ()));
67
64
68
- Intent i = new Intent (SYNC_MESSAGE );
69
- i .putExtra (IN_PROGRESS , true );
70
- i .putExtra (" ACCOUNT_NAME" , account .name );
65
+ Intent i = new Intent (FileSyncService . SYNC_MESSAGE );
66
+ i .putExtra (FileSyncService . IN_PROGRESS , true );
67
+ i .putExtra (FileSyncService . ACCOUNT_NAME , account .name );
71
68
getContext ().sendStickyBroadcast (i );
72
69
73
70
PropFindMethod query ;
74
71
try {
75
- query = new PropFindMethod (getUri ().toString ());
72
+ Log .e ("ASD" , getUri ().toString ());
73
+ query = new PropFindMethod (getUri ().toString ()+"/" );
76
74
getClient ().executeMethod (query );
77
75
MultiStatus resp = null ;
78
76
resp = query .getResponseBodyAsMultiStatus ();
77
+
79
78
if (resp .getResponses ().length > 0 ) {
80
79
WebdavEntry we = new WebdavEntry (resp .getResponses ()[0 ]);
81
80
OCFile file = fillOCFile (we );
@@ -95,7 +94,7 @@ public synchronized void onPerformSync(
95
94
syncResult .stats .numIoExceptions ++;
96
95
e .printStackTrace ();
97
96
}
98
- i .putExtra (IN_PROGRESS , false );
97
+ i .putExtra (FileSyncService . IN_PROGRESS , false );
99
98
getContext ().sendStickyBroadcast (i );
100
99
}
101
100
0 commit comments