ProcessBuilderImplementation
are
+ advised to throw UserQuestionException
in case
+ they need some interaction with user.
+ * Actual behavior depends on the builder implementation, but it should * respect all the properties configured on this builder. + *
+ * Since version 1.34 implementors of this method are advised to throw
+ * a {@link UserQuestionException} in case the execution cannot be
+ * performed and requires additional user confirmation, or configuration.
+ * Callers of this method may check for this exception and handle it
+ * appropriately.
*
* @see ProcessBuilderImplementation
* @return the new {@link Process} based on the properties configured
@@ -235,6 +242,8 @@
* @throws IOException if the process could not be created
* @throws IllegalStateException if there is no executable configured
* by {@link #setExecutable(java.lang.String)}
+ * @throws UserQuestionException if the execution cannot be performed
+ * without permission from the user
*/
@NonNull
@Override
diff -r 2ffb0b254787 extexecution/src/org/netbeans/spi/extexecution/ProcessBuilderImplementation.java
--- a/extexecution/src/org/netbeans/spi/extexecution/ProcessBuilderImplementation.java Wed Sep 19 11:32:54 2012 +0200
+++ b/extexecution/src/org/netbeans/spi/extexecution/ProcessBuilderImplementation.java Wed Sep 19 16:09:20 2012 +0200
@@ -46,6 +46,7 @@
import java.util.Map;
import org.netbeans.api.annotations.common.NonNull;
import org.netbeans.api.annotations.common.NullAllowed;
+import org.openide.util.UserQuestionException;
/**
* The interface representing the implementation
@@ -80,6 +81,10 @@
* @return a process created with specified parameters and environment
* configuration
* @throws IOException IOException if the process could not be created
+ * @throws UserQuestionException in case there is a need to interact with
+ * user, don't be afraid to throw a subclass of
+ * {@link UserQuestionException} with overriden {@link UserQuestionException#confirmed()}
+ * method.
*/
@NonNull
Process createProcess(@NonNull String executable, @NullAllowed String workingDirectory, @NonNull List