// AND together constraints
Constraint allConstraints = fac.and( descendantNodeConstraint, origParentFolderPathConstraint );
if ( StringUtils.hasLength( filter ) ) {
allConstraints = fac.and( allConstraints, origNameConstraint );
}
Query query = fac.createQuery( selector, allConstraints, null, null );
QueryResult result =
session.getWorkspace().getQueryManager().createQuery( query.getStatement(), Query.JCR_JQOM ).execute();
NodeIterator nodeIter = result.getNodes();
List<RepositoryFile> deletedFiles = new ArrayList<RepositoryFile>();