Solved

Which method should I use in p4java api JAVADOC?

Posted on 2013-11-13
1
544 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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 94
solarwind tftp server 2 30
ArrayIndexOutOfBoundException 9 29
Windows Service to Receive TCP Packets 4 30
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now