我正在尝试获取给定TFS项目的子文件夹名称。到目前为止,我已经能够连接到TFS服务器并列出所有项目。请帮助我如何获取每个TFS项目的子文件夹名称。

TFSTeamProjectCollection tpc = connectToTFS();

    // Enumerate the Team Projects.
    for (Project project : tpc.getWorkItemClient().getProjects())
    {
        System.out.println(project.getName());


    }



public static TFSTeamProjectCollection connectToTFS() throws URIException, SQLException
{
    TFSTeamProjectCollection tpc = null;
    Credentials credentials;


    credentials = new UsernamePasswordCredentials("USERNAME","PASSWORD");

    tpc = new TFSTeamProjectCollection(URIUtils.newURI("COLLECTION_URL"), credentials);

    return tpc;
}

最佳答案

使用Workspace类的GetExtendedItems

getExtendedItems
public ExtendedItem[][] getExtendedItems(ItemSpec[] itemSpecs,
                                         DeletedState deletedState,
                                         ItemType itemType,
                                         GetItemsOptions options)


您可以将Git-tf项目用作在Java中使用TFS-SDK的参考。

10-08 12:59