Skip to content

Instantly share code, notes, and snippets.

@chrismetcalf
Created August 2, 2012 19:11
Show Gist options
  • Save chrismetcalf/3239827 to your computer and use it in GitHub Desktop.
Save chrismetcalf/3239827 to your computer and use it in GitHub Desktop.
package com.socrata.school.api;
import java.io.File;
import com.socrata.api.Connection;
import com.socrata.api.HttpConnection;
import com.socrata.api.RequestException;
import com.socrata.data.View;
public class BulkUpdate {
/**
* @param args
* @throws RequestException
*/
public static void main(String[] args) throws RequestException {
Connection c = new HttpConnection("soda.demo.socrata.com", "chris@chrismetcalf.net", "******", "************");
View v = View.find("3dy7-ihbd", c);
// Make a working copy
System.out.println("Copying view " + v.getName() + "(" + v.getId() + ")");
v = v.copy(c);
System.out.println("Got copy " + v.getName() + "(" + v.getId() + ")");
// Do an append
v.append(new File("/Users/metcalf/Dropbox/Socrata/Sample Data/Flat Files/Data.gov/eqs7day-M1-for-bulk.csv"), 1, c);
// Publish the result
v = v.publish(c);
System.out.println("Done!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment