Well. Kind of. Media Library in Kenitco essentially 3 tables: Media_Lirary, Media_File and Media_rolePermision. You are interested in Media_File. If you have a folder in your Media Library it is reflected in the FilePath column of Media_File table.
- So if a file is the root of your library: filepath is
img.gif
- if it is in a subfolder filepath:
Folder1/img.gif
To check if a folder exists you check that filepath contains folder name, i.e. in terms of SQL:
select top 1 * from media_file where filelibraryid = 123 and FilePath like 'folder1/%'
If you get back 1 row - the folder exists
This SQL where clause you can be converted to rest, i.e. you do GET for
~/rest/media.file?format=json&topn=1&Where=UrlEncodedWhere
URL Encode this filelibraryid = 123 and FilePath like 'folder1/%'
so the full URL will be:
~/rest/media.file?format=json&topn=1&Where=filelibraryid%20%3D%20123%20and%20FilePath%20like%20%27folder1%2F%25%27
If you result is not empty - Folder1 exists in the library with libraryid = 123 (check Media_Lirary to get libraryid )