2014-05-21 2 views
0

예를 들어 ONE String []과 동기화 할 때 작동합니다. 이 ONE 대상 폴더에있는 모든 파일을 동기화합니다프로그래밍 방식으로 여러 경로를 Perforce와 동기화하면 작동하지 않는 것처럼 보입니다

String[] paths = new String[]{//path1,//path2,//path3,etc.}; 

"MyFolder에"나는 하나 개 이상의 폴더를 동기화 할 때

IServer server = ServerFactory.getServer("myServer", null); 
server.connect(); 
server.setUserName("myUsername"); 
server.login("myPass"); 
IClient tempClient = new Client(); 
tempClient.setName("tempClient" + UUID.randomUUID().toString().replace("-", "")); 
tempClient.setRoot("myFolder"); 
tempClient.setServer(server); 
server.setCurrentClient(tempClient); 
ClientViewMapping tempMappingEntry = new ClientViewMapping(); 
tempMappingEntry.setLeft("//Connect/..."); 
tempMappingEntry.setRight("//" + tempClient.getName() + "/..."); 
tempMappingEntry.setType(EntryType.INCLUDE); 
ClientView tempClientView = new ClientView(); 
tempClientView.addEntry(tempMappingEntry); 
tempClient.setClientView(tempClientView); 
server.createClient(tempClient); 
try 
{ 
    List<IFileSpec> fileSpecsSet = FileSpecBuilder.makeFileSpecList(pathsUnderDepot);//**HERE** 
tempClient.sync(FileSpecBuilder.getValidFileSpecs(fileSpecsSet), true, false, false, false); 
} 
finally 
{ 
    server.deleteClient(tempClient.getName(), false); 
} 
그러나

, 그것은 동기화되지 않습니다 내 대상 폴더. 여기 제가 지금까지 얻은 것이 있습니다. 코드는 위의 몇 가지 변경 사항과 비슷합니다.

each folder F has multiples paths to sync from 

foreach forlder F in folderList 
{ 
    IServer server = ServerFactory.getServer("myServer", null); 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    tempClient.setRoot(F);//**HERE** 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    ..... 
    try 
    { 
     List<IFileSpec> fileSpecsSet = FileSpecBuilder.makeFileSpecList(F.paths);//**HERE** 
    ..... 
    } 
    finally 
    { 
     ..... 
    } 

내 질문은 내가 예상 한대로 코드 작업을 구현하는 방법입니다. 나는 그 오류가 두 곳에서 왔다고 생각한다. (나는 여기에라고 쓰여있다). 도움이나 제안을 보내 주시면 감사하겠습니다. 콴.

답변

0

문제점 및 해결책을 찾았습니다. 문제는 내 경로에 이 아닌의 날짜 범위가 으로 지원됩니다. PERFORCE Sync.

//path1/[email protected]/05/16,2014/05/18 

오류가 낭포, 그냥 문자열의 오류 부분을 제거, 모든 알고리즘이 원활하게 작동 "/ 5월 18일 2014"라고 입니다. 내 질문에 대해 살펴본 사람들에게 감사드립니다. 콴.

관련 문제