Package com.socrata.datasync

Examples of com.socrata.datasync.HttpUtility


            throw new IOException(e);
        }
    }

    public static String getFTPHost(UserPreferences userPerfs) throws URISyntaxException, IOException {
        HttpUtility http = new HttpUtility(userPerfs, true);
        URI versionApiUri = new URI(userPerfs.getDomain() + VERSION_API_ENDPOINT);
        try(CloseableHttpResponse response = http.get(versionApiUri, ContentType.APPLICATION_JSON.getMimeType())) {
            String regionName = response.getHeaders(X_SOCRATA_REGION)[0].getValue();
            return regionName + FTP_HOST_SUFFIX;
        }
    }
View Full Code Here


        String encoding = fileControl.encoding;
        if (encoding.equalsIgnoreCase("ISO-8859-1") ||
                encoding.equalsIgnoreCase("UTF-8"))
            return JobStatus.VALID;

        HttpUtility http = new HttpUtility();
        String charsetUri = urlBase + charsetsPath;
        ObjectMapper mapper = new ObjectMapper();
        try(CloseableHttpResponse response = http.get(new URI(charsetUri), ContentType.APPLICATION_JSON.getMimeType())) {
            String[] charsets = mapper.readValue(response.getEntity().getContent(), String[].class);
            boolean encodingFound = false;
            for (String charset : charsets) {
                if (encoding.equalsIgnoreCase(charset)) {
                    encodingFound = true;
View Full Code Here

    @Before
    public void setUp() throws Exception {
        mapper = new ObjectMapper();
        UserPreferences userPrefs = getUserPrefs();
        http = new HttpUtility(userPrefs, true);
    }
View Full Code Here

    private ObjectMapper mapper = new ObjectMapper().enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
    private String pathToSignature = null;
    CloseableHttpResponse signatureResponse = null;

    public DeltaImporter2Publisher(UserPreferences userPrefs) {
        http = new HttpUtility(userPrefs, true);
        domain = userPrefs.getHost();
        baseUri = new URIBuilder()
                .setScheme("https")
                .setHost(domain);
    }
View Full Code Here

TOP

Related Classes of com.socrata.datasync.HttpUtility

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.