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;
}
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);
}
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());
}
}
Aggregations