org.kiwiproject.base.process.OsCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kiwi Show documentation
Show all versions of kiwi Show documentation
Kiwi is a utility library. We really like Google's Guava, and also use Apache Commons.
But if they don't have something we need, and we think it is useful, this is where we put it.
The newest version!
package org.kiwiproject.base.process;
import java.util.List;
/**
* Interface that describes a simple contract for an operating system command.
*/
public interface OsCommand {
/**
* Returns a list containing the command and all its arguments, which can then be used to construct
* a {@link ProcessBuilder}.
*
* @return a list of command arguments
* @see ProcessBuilder#ProcessBuilder(List)
*/
List parts();
/**
* Returns a string array containing the command and all its arguments, which can be used to construct
* a {@link ProcessBuilder}.
*
* @return a string array of command arguments
* @see ProcessBuilder#command(String...)
*/
default String[] partsAsArray() {
return parts().toArray(new String[0]);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy