Created
August 2, 2012 19:11
-
-
Save chrismetcalf/3239827 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", "[email protected]", "******", "************"); | |
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