Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.packagecloud.client;
 
 
The main PackageCloud class, delegates calls to a configured Client
public class PackageCloud {
    private final Client client;
    private final ObjectMapper mapper;

    
Instantiates a new PackageCloud object

Parameters:
configuredClient a configured Client
See also:
Client
    public PackageCloud(Client configuredClient) {
        this. = configuredClient;
        this. = new ObjectMapper();
    }

    
Gets available distributions, see the distributions/index api docs.

Returns:
Parsed contents of /api/v1/distributions
Throws:
UnauthorizedException
java.io.IOException
ServerErrorException
        return .readValue(result.getResponse(), Distributions.class);
    }

    
Put package.

Parameters:
pkg the Package to upload
Returns:
the boolean
Throws:
UnauthorizedException
java.io.IOException
ServerErrorException
    public boolean putPackage(Package pkgthrows UnauthorizedExceptionIOExceptionServerErrorException {
        .putPackage(
                pkg.getFilestream(),
                pkg.getFilename(),
                pkg.getRepository(),
                pkg.getDistroVersionId(),
                pkg.getSourceFiles());
        return true;
    }

    
Package contents.

Parameters:
pkg the pkg
Returns:
the contents
Throws:
UnauthorizedException
java.io.IOException
ServerErrorException
    public Contents packageContents(Package pkgthrows Exception {
        Result result = .packageContents(pkg.getFilestream(), pkg.getFilename(), pkg.getRepository());
        return .readValue(result.getResponse(), Contents.class);
    }
New to GrepCode? Check out our FAQ X