* @return filtered children of the Company Home without all the special spaces
*/
public static QueryResult getChildrenFromCompanyHome(String endpoint, String username, String password, int socketTimeout, AuthenticationDetails session) throws IOException {
Reference companyHome = new Reference(STORE, null, XPATH_COMPANY_HOME);
QueryResult queryResult = SearchUtils.getChildren(endpoint, username, password, socketTimeout, session, companyHome);
ResultSet rs = queryResult.getResultSet();
ResultSetRow[] rows = rs.getRows();
List<ResultSetRow> filteredRows = new ArrayList<ResultSetRow>();
for (ResultSetRow row : rows) {
boolean hasFilteredPath = false;
NamedValue[] properties = row.getColumns();
String path = PropertiesUtils.getPropertyValues(properties, PATH_PROPERTY)[0];
for(String excludedPath : EXCLUDED_PATHS){
if(StringUtils.contains(path, excludedPath)){
hasFilteredPath = true;
break;
}
}
if(!hasFilteredPath){
filteredRows.add(row);
}
}
ResultSetRow[] finalFilteredRows = new ResultSetRow[filteredRows.size()];
for(int i=0; i<finalFilteredRows.length; i++){
finalFilteredRows[i] = filteredRows.get(i);
}
rs.setRows(finalFilteredRows);
return queryResult;
}