Solved

Which method should I use in p4java api JAVADOC?

Posted on 2013-11-13
1
566 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression
Suggested Courses

631 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