class FetchAndUnzipProcess implements GeoServerProcess {

    @DescribeResult(name = "filePath", description = "path to the unzipped file")
    public String execute(
            @DescribeParameter(name = "zipUrl", min = 1, max = 1, description = "URL to the zipped file to retrieve") String zipUrl,
            @DescribeParameter(name = "token", min = 1, max = 1, description = "Token for authorizing the upload") String token
            ){
        String unzippedPath = null;
        File unzippedFile = null;
        if (zipUrl.isEmpty() || token.isEmpty()) {
            LOGGER.info("Missing zipUrl or token in the FetchAndUnzipProcess.");
        }
        else {
            LOGGER.info("In FetchAndUnzipProcess on Geoserver with zip url and token:" + zipUrl);
        }
        
        if(isAuthorized(token)){
            ZipInputStream zipStream = getZipFromUrl(zipUrl, getHttpClient());
            unzippedFile = unzipToDir(zipStream, getNewZipDestination());
            unzippedPath = unzippedFile.getAbsolutePath();
        } else {
            throw new ProcessException( new SecurityException("Not Authorized."));
        }
        return unzippedPath;
    }

}