mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
OC-2582: Add methods isFileShareByLink and getFilePublicLink to FileDataStorageManager
This commit is contained in:
parent
b038cac0cd
commit
7aeda0b4dc
1 changed files with 30 additions and 0 deletions
|
@ -715,5 +715,35 @@ public class FileDataStorageManager {
|
|||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the file/folder is shared by link or not
|
||||
* @param path Path of the file/folder
|
||||
* @return
|
||||
*/
|
||||
public boolean isFileShareByLink(String path) {
|
||||
Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
|
||||
OCFile file = null;
|
||||
if (c.moveToFirst()) {
|
||||
file = createFileInstance(c);
|
||||
}
|
||||
c.close();
|
||||
return file.isShareByLink();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the public link of the file/folder
|
||||
* @param path Path of the file/folder
|
||||
* @return
|
||||
*/
|
||||
public String getFilePublicLink(String path) {
|
||||
Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
|
||||
OCFile file = null;
|
||||
if (c.moveToFirst()) {
|
||||
file = createFileInstance(c);
|
||||
}
|
||||
c.close();
|
||||
return file.getPublicLink();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue