projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
complete two way synchronization
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
datamodel
/
FileDataStorageManager.java
diff --git
a/src/com/owncloud/android/datamodel/FileDataStorageManager.java
b/src/com/owncloud/android/datamodel/FileDataStorageManager.java
index
49a88c3
..
244d6d1
100644
(file)
--- a/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
+++ b/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
@@
-72,7
+72,7
@@
public class FileDataStorageManager implements DataStorageManager {
c.close();
return file;
}
c.close();
return file;
}
-
+
@Override
public OCFile getFileById(long id) {
Cursor c = getCursorForValue(ProviderTableMeta._ID, String.valueOf(id));
@Override
public OCFile getFileById(long id) {
Cursor c = getCursorForValue(ProviderTableMeta._ID, String.valueOf(id));
@@
-83,6
+83,16
@@
public class FileDataStorageManager implements DataStorageManager {
c.close();
return file;
}
c.close();
return file;
}
+
+ public OCFile getFileByLocalPath(String path) {
+ Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
+ OCFile file = null;
+ if (c.moveToFirst()) {
+ file = createFileInstance(c);
+ }
+ c.close();
+ return file;
+ }
@Override
public boolean fileExists(long id) {
@Override
public boolean fileExists(long id) {
@@
-399,7
+409,7
@@
public class FileDataStorageManager implements DataStorageManager {
return file;
}
return file;
}
- public void removeFile(OCFile file) {
+ public void removeFile(OCFile file
, boolean removeLocalCopy
) {
Uri file_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, ""+file.getFileId());
if (getContentProvider() != null) {
try {
Uri file_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, ""+file.getFileId());
if (getContentProvider() != null) {
try {
@@
-414,7
+424,7
@@
public class FileDataStorageManager implements DataStorageManager {
ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",
new String[]{mAccount.name});
}
ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",
new String[]{mAccount.name});
}
- if (file.isDown()) {
+ if (file.isDown()
&& removeLocalCopy
) {
new File(file.getStoragePath()).delete();
}
}
new File(file.getStoragePath()).delete();
}
}