import java.io.*;
import java.util.*;
import com.perforce.api.*;
public class GetChange {
public static void main(String[] argv) {
/* Please see the Common.java file to see how the environment is being
* set up. This is important, but it is common to all the examples.
*/
Env env = Common.setup();
Change chng = new Change(33333);
String fileName;
// You should use ArrayList for better performce; these are old exmaples
Vector files;
try {
chng.sync();
files=chng.getFiles();
System.out.println( "Total files are : " + files.size());
fileName=(String)files.elementAt(0);
System.out.println( "File is : " + fileName );
if (fileName.startsWith("//Development")) {
System.out.println("File belongs to Development branch");
}
else {
System.out.println("File doesn't belong to Development branch");
}
} catch (Exception ex) {
ex.printStackTrace();
}
Utils.cleanUp();
}
}