[yocto] [RFC Refactor[v2] 2/8] Add YoctoCommand utility class

Ioana Grigoropol ioanax.grigoropol at intel.com
Fri Jun 7 07:51:17 PDT 2013


- YoctoCommand wraps all information needed for running a remote command
	- the actual command string
	- the command arguments
	- the directory in which to run the remote command
	- a ProcessStreamBuffer that will store the output of running this particular command
- this class will simplify the process of running a remote command by wrapping all needed data into one object

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol at intel.com>
---
 .../src/org/yocto/remote/utils/YoctoCommand.java   |   63 ++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/YoctoCommand.java

diff --git a/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/YoctoCommand.java b/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/YoctoCommand.java
new file mode 100644
index 0000000..b37d526
--- /dev/null
+++ b/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/YoctoCommand.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Intel Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ioana Grigoropol(Intel) - initial API and implementation
+ *******************************************************************************/
+package org.yocto.remote.utils;
+
+
+public class YoctoCommand {
+	private String command;
+	private String initialDirectory;
+	private String arguments;
+	private ProcessStreamBuffer processBuffer;
+
+	public YoctoCommand(String command, String initialDirectory, String arguments){
+		this.setCommand(command);
+		this.setInitialDirectory(initialDirectory);
+		this.setArguments(arguments);
+		this.setProcessBuffer(new ProcessStreamBuffer(false));
+	}
+
+	public String getCommand() {
+		return command;
+	}
+
+	public void setCommand(String command) {
+		this.command = command;
+	}
+
+	public String getInitialDirectory() {
+		return initialDirectory;
+	}
+
+	public void setInitialDirectory(String initialDirectory) {
+		this.initialDirectory = initialDirectory;
+	}
+
+	public String getArguments() {
+		return arguments;
+	}
+
+	public void setArguments(String arguments) {
+		this.arguments = arguments;
+	}
+
+	public ProcessStreamBuffer getProcessBuffer() {
+		return processBuffer;
+	}
+
+	public void setProcessBuffer(ProcessStreamBuffer processBuffer) {
+		this.processBuffer = processBuffer;
+	}
+
+	@Override
+	public String toString() {
+		return command + " " + arguments;
+	}
+}
-- 
1.7.9.5




More information about the yocto mailing list