Search in sources :

Example 1 with GenlinkOperationResult

use of org.syncany.operations.init.GenlinkOperationResult in project syncany by syncany.

the class GenlinkCommand method execute.

@Override
public int execute(String[] operationArgs) throws Exception {
    GenlinkOperationOptions operationOptions = parseOptions(operationArgs);
    GenlinkOperationResult operationResult = new GenlinkOperation(config, operationOptions).execute();
    printResults(operationResult);
    return 0;
}
Also used : GenlinkOperation(org.syncany.operations.init.GenlinkOperation) GenlinkOperationOptions(org.syncany.operations.init.GenlinkOperationOptions) GenlinkOperationResult(org.syncany.operations.init.GenlinkOperationResult)

Example 2 with GenlinkOperationResult

use of org.syncany.operations.init.GenlinkOperationResult in project syncany by syncany.

the class GenlinkCommand method printResults.

@Override
public void printResults(OperationResult operationResult) {
    GenlinkOperationResult concreteOperationResult = (GenlinkOperationResult) operationResult;
    if (!machineReadableOutput) {
        out.println();
        out.println("To share the same repository with others, you can share this link:");
    }
    printLink(concreteOperationResult, machineReadableOutput);
}
Also used : GenlinkOperationResult(org.syncany.operations.init.GenlinkOperationResult)

Example 3 with GenlinkOperationResult

use of org.syncany.operations.init.GenlinkOperationResult in project syncany by syncany.

the class GenlinkFolderRequestHandler method handleRequest.

@Override
public Response handleRequest(FolderRequest request) {
    GenlinkFolderRequest concreteRequest = (GenlinkFolderRequest) request;
    try {
        GenlinkOperation operation = new GenlinkOperation(config, concreteRequest.getOptions());
        GenlinkOperationResult operationResult = operation.execute();
        GenlinkFolderResponse response = new GenlinkFolderResponse(operationResult, request.getId());
        return response;
    } catch (Exception e) {
        logger.log(Level.WARNING, "Cannot generate link.", e);
        return new BadRequestResponse(request.getId(), "Cannot execute operation: " + e.getMessage());
    }
}
Also used : GenlinkOperation(org.syncany.operations.init.GenlinkOperation) GenlinkOperationResult(org.syncany.operations.init.GenlinkOperationResult)

Aggregations

GenlinkOperationResult (org.syncany.operations.init.GenlinkOperationResult)3 GenlinkOperation (org.syncany.operations.init.GenlinkOperation)2 GenlinkOperationOptions (org.syncany.operations.init.GenlinkOperationOptions)1