[p4] P4 Java API -- file not syncing properly

Scott Brodersen sbroders at adobe.com
Thu Sep 13 06:41:28 PDT 2007


Hi,
 
I am using the P4 Java API to create client software that interacts with
the server.
 
I'm using the FileEntry class, sync() method, to fetch files and place
them on the HD. Pretty basic stuff it seems. However, when I call the
method, the file does not appear to be sync'ed, and no error is thrown.
 
Any suggestions would be much appreciated.
 
thanks
scott
 
Code:
 
 public static String syncFile(String p4path){
  FileEntry file = new FileEntry(P4Env,p4path);
  try{
   file.sync();
   System.out.println("synced file: " + p4path);
   return file.getClientPath();
  }catch (Exception e){
   StackTraceElement[] ste;
   ste=e.getStackTrace();
   for(int i=0;i<ste.length;i++){
    System.out.println(ste[i].toString());
   }
  }
 }
 
stdout:
 
P4Process.exec: p4 -s -p <server>:<port> -u <username> -c <clientname>
-P temp_0000 fstat //test/scott/builds/pdf1/pdf1.xml 
P4Process.exec().is: java.io.BufferedInputStream at 1e97676
P4Process.exec().isr: java.io.InputStreamReader at 540408
P4Process.exec().es: java.io.FileInputStream at 1a626f
P4Process.exec().esr: java.io.InputStreamReader at 34a1fc
P4Process.exec().os: java.io.BufferedOutputStream at 176c74b
P4Process.exec().osw: java.io.OutputStreamWriter at 116471f
P4Process: Thread is not done yet.
P4Process: Sleeping...
P4Process: Thread is not done yet.
P4Process: Sleeping...
P4Process: Thread is not done yet.
P4Process: Sleeping...
P4Process: Thread is not done yet.
P4Process: Sleeping...
>From P4:info1: depotFile //test/scott/builds/pdf1/pdf1.xml
P4Process.readLine(): depotFile //test/scott/builds/pdf1/pdf1.xml
>From P4:info1: clientFile
C:\perforce_halifax1777\test\scott\builds\pdf1\pdf1.xml
P4Process.readLine(): clientFile
C:\perforce_halifax1777\test\scott\builds\pdf1\pdf1.xml
>From P4:info1: headAction edit
P4Process.readLine(): headAction edit
>From P4:info1: headType text
P4Process.readLine(): headType text
>From P4:info1: headTime 1189609921
P4Process.readLine(): headTime 1189609921
>From P4:info1: headRev 5
P4Process.readLine(): headRev 5
>From P4:info1: headChange 12556
P4Process.readLine(): headChange 12556
>From P4:exit: 0
P4 Exec Complete.
 


More information about the perforce-user mailing list