RepositoryFileTree tree = repo.getTree( repositoryRequest );
// Filter system folders from non-admin users.
// PDI uses this web-service and system folders must be returned to admin repository database connections.
List<RepositoryFileTree> files = new ArrayList<RepositoryFileTree>();
IAuthorizationPolicy policy = PentahoSystem.get( IAuthorizationPolicy.class );
boolean isAdmin = policy.isAllowed( AdministerSecurityAction.NAME );
for ( RepositoryFileTree file : tree.getChildren() ) {
Map<String, Serializable> fileMeta = repo.getFileMetadata( file.getFile().getId() );
boolean isSystemFolder =
fileMeta.containsKey( IUnifiedRepository.SYSTEM_FOLDER ) ? (Boolean) fileMeta
.get( IUnifiedRepository.SYSTEM_FOLDER ) : false;