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.
Type | Name and description |
---|---|
static File |
createTempDir(File self) |
static File |
createTempDir(File self, String prefix, String suffix) |
static long |
currentTimeSeconds(System self) Get the current time in seconds |
static ResourceBundle |
getBundle(ResourceBundle self, String bundleName) Works exactly like ResourceBundle.getBundle(String). |
static ResourceBundle |
getBundle(ResourceBundle self, String bundleName, Locale locale) Works exactly like ResourceBundle.getBundle(String, Locale). |
static Matcher |
getLastMatcher(Matcher self) Get the last hidden matcher that the system used to do a match. |
static Date |
parse(Date self, String format, String input) Parse a String into a Date instance using the given pattern. |
static Date |
parse(Date self, String format, String input, TimeZone zone) Parse a String into a Date instance using the given pattern and TimeZone. |
static Date |
parseToStringDate(Date self, String dateToString) Parse a String matching the pattern EEE MMM dd HH:mm:ss zzz yyyy containing US-locale-constants only (e.g. |
static void |
sleep(Object self, long milliseconds) Sleep for so many milliseconds, even if interrupted. |
static void |
sleep(Object self, long milliseconds, Closure onInterrupt) Sleep for so many milliseconds, using a given closure for interrupt processing. |
static Thread |
start(Thread self, Closure closure) Start a Thread with the given closure as a Runnable instance. |
static Thread |
start(Thread self, String name, Closure closure) Start a Thread with a given name and the given closure as a Runnable instance. |
static Thread |
startDaemon(Thread self, Closure closure) Start a daemon Thread with the given closure as a Runnable instance. |
static Thread |
startDaemon(Thread self, String name, Closure closure) Start a daemon Thread with a given name and the given closure as a Runnable instance. |
Get the current time in seconds
self
- placeholder variable used by Groovy categories; ignored for default static methodsWorks exactly like ResourceBundle.getBundle(String). This is needed because the java method depends on a particular stack configuration that is not guaranteed in Groovy when calling the Java method.
self
- placeholder variable used by Groovy categories; ignored for default static methodsbundleName
- the name of the bundle.Works exactly like ResourceBundle.getBundle(String, Locale). This is needed because the java method depends on a particular stack configuration that is not guaranteed in Groovy when calling the Java method.
self
- placeholder variable used by Groovy categories; ignored for default static methodsbundleName
- the name of the bundle.locale
- the specific localeGet the last hidden matcher that the system used to do a match.
self
- placeholder variable used by Groovy categories; ignored for default static methodsParse a String into a Date instance using the given pattern. This convenience method acts as a wrapper for SimpleDateFormat.
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
self
- placeholder variable used by Groovy categories; ignored for default static methodsformat
- pattern used to parse the input string.input
- String to be parsed to create the date instanceParse a String into a Date instance using the given pattern and TimeZone. This convenience method acts as a wrapper for SimpleDateFormat.
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
self
- placeholder variable used by Groovy categories; ignored for default static methodsformat
- pattern used to parse the input string.input
- String to be parsed to create the date instancezone
- TimeZone to use when parsingParse a String matching the pattern EEE MMM dd HH:mm:ss zzz yyyy containing US-locale-constants only (e.g. Sat for Saturdays). Such a string is generated by the toString method of Date
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
self
- placeholder variable used by Groovy categories; ignored for default static methodsdateToString
- String to be parsed to create the date instance. Must match the pattern EEE MMM dd HH:mm:ss zzz yyyy with US-locale symbolsSleep for so many milliseconds, even if interrupted.
self
- placeholder variable used by Groovy categories; ignored for default static methodsmilliseconds
- the number of milliseconds to sleepSleep for so many milliseconds, using a given closure for interrupt processing.
self
- placeholder variable used by Groovy categories; ignored for default static methodsmilliseconds
- the number of milliseconds to sleeponInterrupt
- interrupt handler, InterruptedException is passed to the Closure
as long as it returns false, the sleep continuesStart a Thread with the given closure as a Runnable instance.
self
- placeholder variable used by Groovy categories; ignored for default static methodsclosure
- the Runnable closureStart a Thread with a given name and the given closure as a Runnable instance.
self
- placeholder variable used by Groovy categories; ignored for default static methodsname
- the name to give the threadclosure
- the Runnable closureStart a daemon Thread with the given closure as a Runnable instance.
self
- placeholder variable used by Groovy categories; ignored for default static methodsclosure
- the Runnable closureStart a daemon Thread with a given name and the given closure as a Runnable instance.
self
- placeholder variable used by Groovy categories; ignored for default static methodsname
- the name to give the threadclosure
- the Runnable closure