/**
 * 
 */

package org.nuxeo.drive.operations;

import java.util.ArrayList;
import java.util.List;

import org.nuxeo.ecm.automation.core.Constants;
import org.nuxeo.ecm.automation.core.annotations.Context;
import org.nuxeo.ecm.automation.core.annotations.Operation;
import org.nuxeo.ecm.automation.core.annotations.OperationMethod;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.api.repository.Repository;
import org.nuxeo.ecm.core.api.repository.RepositoryManager;

import edu.emory.mathcs.backport.java.util.Collections;

/**
 * Fetch the list of the repositories registered on the server.
 * 
 * TODO: move this to the list of default operations in 5.7.
 */
@Operation(id = GetRepositoriesOperation.ID, category = Constants.CAT_FETCH, label = "List repository names on the server")
public class GetRepositoriesOperation {

    public static final String ID = "GetRepositories";

    @Context
    protected RepositoryManager repositoryManager;

    @OperationMethod
    public List<String> run() throws ClientException {
        List<String> repositoryNames = new ArrayList<String>();
        for (Repository rep : repositoryManager.getRepositories()) {
            repositoryNames.add(rep.getName());
        }
        // Make order deterministic to make it simpler to write tests.
        Collections.sort(repositoryNames);
        return repositoryNames;
    }

}

@@ -1,15 +1,14 @@
 /**%0A *
- 
 %0A */%0A%0Apa
@@ -70,16 +70,46 @@
 ayList;%0A
+import java.util.Collections;%0A
 import j
@@ -521,65 +521,8 @@
 r;%0A%0A
-import edu.emory.mathcs.backport.java.util.Collections;%0A%0A
 /**%0A
@@ -587,17 +587,16 @@
 rver.%0A *
- 
 %0A * TODO

Fix bad Arrays import