public static String getLocationHeader()

in src/main/java/org/apache/sling/testing/clients/util/HttpUtils.java [145:160]


    public static String getLocationHeader(HttpResponse response) throws TestingValidationException {
        if (response == null) throw new TestingValidationException("Response must not be null!");

        String locationPath = null;
        Header locationHeader = response.getFirstHeader("Location");
        if (locationHeader != null) {
            String location = locationHeader.getValue();
            URI locationURI = URI.create(location);
            locationPath = locationURI.getPath();
        }

        if (locationPath == null) {
            throw new TestingValidationException("not able to determine location path");
        }
        return locationPath;
    }