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; }  @DescribeResult(name = "filePath", description = "path to the unzipped file") 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 makeSafeFileName(); static final String FILE_NAME_PREFIX; }
@Test public void testExecuteWithBadAuth() { try{ instance.execute("http: } catch(ProcessException ex){ if(!(ex.getCause() instanceof SecurityException)){ fail("when presented with a bad token, a SecurityException wrapped in a Process Exception should be thrown"); } } }