This API is used to export the existing batch class. This method will take the batch class identifier and learnt-sample to be exported with the batch class.

Request Method POST

Web Service URL: http://{serverName}:{port}/dcma/rest/exportBatchClass


Input Parameter Values Descriptions
identifier This value should not be empty and valid batch class identifier. This parameter is used for identifying which batch class is to be exported.
lucene-search-classification-sample Either “true”/”false” This parameter is used to decide if the lucene learnt sample is exported with batch class or not.
image-classification-sample Either “true”/”false” This parameter is used to decide if the image classification sample is exported with batch class or not.



  1. Identifier should be a valid batch class identifier.

Sample client code using apache commons http client:-

private static void exportBatchClass() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/exportBatchClass";
		PostMethod mPost = new PostMethod(url);
		String batchClassIdentifier = "BC4";
		mPost.addParameter("identifier", batchClassIdentifier);
		mPost.addParameter("lucene-search-classification-sample", "true");
		mPost.addParameter("image-classification-sample", "false");
		int statusCode;
		try {
			statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Batch class exported successfully");
				InputStream in = mPost.getResponseBodyAsStream();
				File f = new File("C:\\sample\\");
				FileOutputStream fos = new FileOutputStream(f);
				try {
					byte[] buf = new byte[1024];
					int len =;
					while (len > 0) {
						fos.write(buf, 0, len);
						len =;
				} finally {
					if (fos != null) {
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
		} catch (HttpException e) {
		} catch (IOException e) {
		} finally {
			if (mPost != null) {

Was this article helpful to you?


Comments are closed.