I want to get the CmisDocument of this CMIS remote file: server1/dir1/file1
.
I already have the CmisFolder for server1/dir1
.
I also have the filename "file1"
as a string.
Any elegant way to get the CmisDocument?
Below is my very inelegant attempt:
IDocument document = null;
foreach(ICmisObject obj in remoteFolder.GetChildren())
{
if (obj is IDocument)
{
document = (IDocument)obj;
if (document.Name.Equals(fileName))
{
break;
}
}
}
You could try using a query:
You can also change cmis:document to the specific table/class that contains your document to make your query a little faster.