This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 664ed94e97 GROOVY-8162: Update Groovysh to JLine3 (support /slurp for
CSV)
664ed94e97 is described below
commit 664ed94e972dce13879fb385dc4351f6662e9506
Author: Paul King <[email protected]>
AuthorDate: Wed Jul 23 13:05:57 2025 +1000
GROOVY-8162: Update Groovysh to JLine3 (support /slurp for CSV)
---
.../apache/groovy/groovysh/util/ClassUtils.groovy | 45 ++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git
a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/util/ClassUtils.groovy
b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/util/ClassUtils.groovy
new file mode 100644
index 0000000000..edc39f49c0
--- /dev/null
+++
b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/util/ClassUtils.groovy
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.groovy.groovysh.util
+
+import org.apache.groovy.groovysh.jline.GroovyEngine
+
+class ClassUtils {
+ private ClassUtils() {
+ // utility class
+ }
+
+ static boolean lookFor(String s) {
+ try {
+ Class.forName(s)
+ return true
+ } catch (Exception ignore) {
+ return false
+ }
+ }
+
+ static boolean lookFor(GroovyEngine engine, String s) {
+ try {
+ engine.execute("Class.forName('$s')")
+ return true
+ } catch (Exception ignore) {
+ return false
+ }
+ }
+}