Searching on the Documentation, there are no examples about it, just snippet of code that address specific paths.
Like this:
Get the parent folder of a subpath:
String childFolderPath = "/Loans/MyLoans";
Folder currentFolder = Factory.Folder.fetchInstance(os, childFolderPath, null);
Folder parent = currentFolder.get_Parent();
Get the folders directly contained in a path
String folderPath = "/Loans";
Folder currentFolder = Factory.Folder.fetchInstance(os, folderPath, null);
FolderSet childFolders = currentFolder.get_SubFolders();
By the way, doing a research via FEM, it's easy to build a sql that addresses only part of the name. Like this:
SELECT * FROM [Folder] WHERE ([FolderName] like '%Folder1a%')
Similarly with a custom metadata:
SELECT * FROM [YourFolderSubType] WHERE ([YourCustomAttribute] = 'yourValue')
Then, accessing the attribute PathName
gives you the complete path. Or, alternatively, you could just retrieve its ID
in order to fetch the Folder object from it.
You could try to execute a query like these from the APIs, then cast each result as a Folder object in order to work on it.
An example (untested):
SearchSQL sqlObject = new SearchSQL(sqlStatement);
RepositoryRowSet rowSet = searchScope.fetchRows(sqlObject, null, null, new Boolean(true));
Iterator iter = myRows.iterator();
while (iter.hasNext()) {
RepositoryRow row = (RepositoryRow) iter.next();
row.getProperties().getStringValue("ID");
com.filenet.api.core.Folder folder = Factory.Folder.fetchInstance(os, id, null);
}
Hope this helps.