Solved

Which method should I use in p4java api JAVADOC?

Posted on 2013-11-13
1
551 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

773 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