/**
 * Copyright 2012 Torsten Walter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package de.torstenwalter.maven.plugins;

import org.apache.commons.exec.CommandLine;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.plugin.MojoFailureException;

public abstract class AbstractDatapumpMojo extends AbstractDBMojo {

	/**
	 * @parameter
	 */
	protected String content;

	/**
	 * @parameter
	 * @required
	 */
	protected String directory;

	/**
	 * @parameter
	 */
	protected String dumpfile;

	/**
	 * @parameter
	 */
	protected String exclude;

	/**
	 * @parameter
	 */
	protected String include;

	/**
	 * @parameter
	 */
	private String logfile;

	/**
	 * @parameter
	 */
	protected String schemas;

	public AbstractDatapumpMojo() {
		super();
	}

	protected void addCommonArguments(CommandLine commandLine)
			throws MojoFailureException {
		commandLine.addArgument("'" + getConnectionIdentifier() + "'", false);

		if (StringUtils.isNotEmpty(content)) {
			commandLine.addArgument("CONTENT=" + content);
		}

		commandLine.addArgument("DIRECTORY=" + directory);

		if (StringUtils.isNotEmpty(dumpfile)) {
			commandLine.addArgument("DUMPFILE=" + dumpfile);
		}

		if (StringUtils.isNotEmpty(exclude)) {
			commandLine.addArgument("EXCLUDE=" + exclude);
		}

		if (StringUtils.isNotEmpty(exclude)) {
			commandLine.addArgument("EXCLUDE=" + exclude);
		}

		if (StringUtils.isNotEmpty(include)) {
			commandLine.addArgument("INCLUDE=" + include);
		}

		if (StringUtils.isNotEmpty(logfile)) {
			commandLine.addArgument("LOGFILE=" + logfile);
		}

		if (StringUtils.isNotEmpty(schemas)) {
			commandLine.addArgument("SCHEMAS=" + schemas);
		}
	}

}
@@ -1212,29 +1212,137 @@
 %0A%09pr
-otected String schema
+ivate String network_link;%0A%0A%09/**%0A%09 * @parameter%0A%09 */%0A%09protected String schemas;%0A%0A%09/**%0A%09 * @parameter%0A%09 */%0A%09protected String table
 s;%0A%0A
@@ -1905,104 +1905,8 @@
 %09%7D%0A%0A
-%09%09if (StringUtils.isNotEmpty(exclude)) %7B%0A%09%09%09commandLine.addArgument(%22EXCLUDE=%22 + exclude);%0A%09%09%7D%0A%0A
 %09%09if
@@ -2126,66 +2126,270 @@
 pty(
-schemas)) %7B%0A%09%09%09commandLine.addArgument(%22SCHEMAS=%22 + schema
+network_link)) %7B%0A%09%09%09commandLine.addArgument(%22NETWORK_LINK=%22 + network_link);%0A%09%09%7D%0A%0A%09%09if (StringUtils.isNotEmpty(schemas)) %7B%0A%09%09%09commandLine.addArgument(%22SCHEMAS=%22 + schemas);%0A%09%09%7D%0A%0A%09%09if (StringUtils.isNotEmpty(tables)) %7B%0A%09%09%09commandLine.addArgument(%22TABLES=%22 + table
 s);%0A

Update AbstractDatapumpMojo.java