All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.daisy.pipeline.client.Scripts Maven / Gradle / Ivy

There is a newer version: 5.0.1
Show newest version
package org.daisy.pipeline.client;

/**
 * Methods for communicating with the "/scripts" resource in a Pipeline 2 Web Service.
 * 
 * @see http://code.google.com/p/daisy-pipeline/wiki/WebServiceAPI#Scripts
 * 
 * @author jostein
 */
public class Scripts {

	/**
	 * Get all scripts
	 * 
	 * HTTP 200 OK: Response body contains XML data
	 * HTTP 401 Unauthorized: Client was not authorized to perform request.
	 * @throws Pipeline2WSException 
	 */
	public static Pipeline2WSResponse get(String endpoint, String username, String secret) throws Pipeline2WSException {
		return Pipeline2WS.get(endpoint, "/scripts", username, secret, null);
	}

	/**
	 * Get a single script
	 * 
	 * HTTP 200 OK: Response body contains XML data
	 * HTTP 401 Unauthorized: Client was not authorized to perform request.
	 * HTTP 404 Not Found: Resource not found
	 * @throws Pipeline2WSException 
	 */
	public static Pipeline2WSResponse get(String endpoint, String username, String secret, String id) throws Pipeline2WSException {
		return Pipeline2WS.get(endpoint, "/scripts/"+id, username, secret, null);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy