Package org.syncany.operations.ls

Examples of org.syncany.operations.ls.LsOperationResult


  public Response handleRequest(FolderRequest request) {
    LsFolderRequest concreteRequest = (LsFolderRequest) request;

    try {
      LsOperation operation = new LsOperation(config, concreteRequest.getOptions());
      LsOperationResult operationResult = operation.execute();
      LsFolderResponse response = new LsFolderResponse(operationResult, request.getId());
   
      return response;
    }
    catch (Exception e) {
View Full Code Here


  }

  @Override
  public int execute(String[] operationArgs) throws Exception {
    LsOperationOptions operationOptions = parseOptions(operationArgs);
    LsOperationResult operationResult = client.ls(operationOptions);

    printResults(operationResult);

    return 0;
 
View Full Code Here

    return operationOptions;
  }

  @Override
  public void printResults(OperationResult operationResult) {
    LsOperationResult concreteOperationResult = (LsOperationResult) operationResult;
   
    int longestSize = calculateLongestSize(concreteOperationResult.getFileTree());
    int longestVersion = calculateLongestVersion(concreteOperationResult.getFileTree());

    if (fetchHistories) {
      printHistories(concreteOperationResult, longestSize, longestVersion);       
    }
    else {
View Full Code Here

    // Check if the file histories were based on the correct originals
    LsOperationOptions options = new LsOperationOptions();
    options.setFetchHistories(true);
    options.setPathExpression("moved_folder/subfolder1/");
   
    LsOperationResult lsOperationResult = clientA.ls(options);
   
    for (PartialFileHistory fileHistory : lsOperationResult.getFileVersions().values()) {
      assertTrue(fileHistory.getFileVersion(2).getPath().endsWith(fileHistory.getFileVersion(1).getPath()));
    }
   
    options.setPathExpression("moved_folder/subfolder2/");
   
    lsOperationResult = clientA.ls(options);
   
    for (PartialFileHistory fileHistory : lsOperationResult.getFileVersions().values()) {
      assertTrue(fileHistory.getFileVersion(2).getPath().endsWith(fileHistory.getFileVersion(1).getPath()));
    }

    // Tear down
    clientA.deleteTestData();
View Full Code Here

TOP

Related Classes of org.syncany.operations.ls.LsOperationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.