Solved

Which method should I use in p4java api JAVADOC?

Posted on 2013-11-13
1
556 Views
Last Modified: 2013-11-14
Hi,
I try to get the list of workspaces a user has by using the P4JAVA API.

However, I couldn't figure out which class and which method I should use from the JavaDoc they provided.

This is the JAVADOC I found for p4java.

Can you please help me with this?

Thanks,
0
Comment
Question by:Tolgar
1 Comment
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39646532
It appears that in the Javadoc the term "client" is what is used for what you are thinking of as "workspace". So the IServer.getClients() is probably what you need to use. Something along the lines of...
String username = "george";
List<IClientSummary> clientSummaries = ServerFactory.getServer("p4java://perforce.mycompany.com:1666", null).getClients(username, null, 0);
System.out.println("Workspaces for '" + username + "'...");
for (IClientSummary clientSummary : clientSummaries) {
    System.out.println(clientSummary.getName() + " (" + clientSummary.getRoot() + ")");
}

Open in new window

(Obviously, change the host, port and username to whatever you need for your environment)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question