removing some obvious warnings as first step to -Werror
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / FileDataStorageManager.java
index 7bb29d4..161eb08 100644 (file)
@@ -38,7 +38,6 @@ import android.content.ContentValues;
 import android.content.OperationApplicationException;
 import android.database.Cursor;
 import android.net.Uri;
-import android.os.Environment;
 import android.os.RemoteException;
 import android.util.Log;
 
@@ -72,7 +71,7 @@ public class FileDataStorageManager implements DataStorageManager {
         c.close();
         return file;
     }
-
+    
     @Override
     public OCFile getFileById(long id) {
         Cursor c = getCursorForValue(ProviderTableMeta._ID, String.valueOf(id));
@@ -83,6 +82,16 @@ public class FileDataStorageManager implements DataStorageManager {
         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) {