This is a follow up to the question asked here: http://stackoverflow.com/questions/3360191/groovy-parsing-text-file
The difference now is my file has a header, I attempted to read past the header first and then onto the content that I am wanting, but for some reason it doesn't seem to cooperate.
def dataList = []
def theInfoName = 'tes...
Hey there,
i'm currently working on a Eclipse RCP Project. I have a Plugin Fragment where i store my Unit Tests. I like to store the Groovy Unit Tests there as well. But when i try to create a Groovy unit test, Eclipse doesn't let me, because the fragment is not a Groovy Project. Is there a way to run the the groovy tests inside the fr...
How do I do the following in groovy:
while (somethingIsntReady || now.isAfter(before + 5 minutes)) {
sleep(1000)
}
Right now I do something like this:
i = 1
while (!finishedFile.exists() && i in 1..300) {
sleep(1000)
i++
}
which doesn't seem right in groovy because it's just the way I would do it in java.
...
Like most professionals in the area of software development, I'm always open for learning new technologies/frameworks that might improve productivity. Relatively speaking, I'm still a novice in the area(3-4 years of experience) and my first contact with software development was in the .NET plataform with VB.NET language. At the time I ha...
If I have a Java class with the properties "firstName" and "lastName", I want to dynamically assign the property based on variables. To give an example:
public class MyClass {
public String firstName;
public String lastName;
}
...
def varname = "firstName";
def value = "Smith";
def instance = new MyClass();
/* Something like th...
I'm using Eclipse and I have the Groovy Plugin installed.
From within a standard Java project I want to include a file with a .groovy extension on the runtime classpath. I have a source folder (src/main/resources) which includes all files and has no exclusion filters. Inside that directory I have 2 files: foo.groovy and foo.txt. When...
Hi there,
Well, I think my question says it all. I need to know if Groovy SQL supports two phase commits. I'm actually programming a Grails Service where I want to define a method which does the following:
Get SQL instance for Database 1,
Get SQL instance for Databsae 2,
Open a transaction some how:
Within the transaction call two dif...
Could i parse JSON string as GPathResult ?
Or something with similar interface... I just have some code which doing some work with XML and i want to add JSON support. But GPathResult is very specific class and slightly differs form JSONObject or JSONArray.
...
I need to create a filter that is triggered on any save/update action in order to record the history of whats being done. I am having a problem getting id of the object that is being manipulated.
My controllers simplified:
class FooController {
static allowedMethods = [save: "POST", update: "POST", delete: "POST"]
def save = ...
I created a basic tcp client and server in groovy and I'm wanting to send maps from the server to the client, I'm wondering if I'm able send maps across and still being able to access the values.
//TCP Server
def book1 = [Title of Book: "Groovy Recipes", Author: "Scott Davis", Number of Pages: "241"]
server = new ServerSocket(2000)
p...
I am doing a gradle/OSGi build....
I have the OSGi bundle building fine, but want to automate the bundle deployment. I don't think there is a gradle task for this, so this becomes a groovy question. To deploy to an osgi container you do the following: 1) telnet to the OSGi container port 2) send ss command to list the bundles 3) pars...
I am a complete noob when it comes to grails (and still very noobish when it comes to groovy) so I apologise if this is a dumb question.
I am building a simple web app and I want to control portions of the domain in my app based on file system objects (i.e. directory structure and file type) rather than database data. How easy is it to ...
Hi,
i'm trying to use the groovy httpbuilder to make a post to the microsoft exchange webservice (EWS). My problem is, I'm unable to set the proper request content-type. The library seems to have its own mind here.
Does anyone have an idea?
Cheers,
Stephan
Here is my code:
url = "http://exchangeserver/ews/Exchange.asmx"
p_...
I'm trying to do some basic queries using the groovy.sql.Sql object, and I'm getting a SQLException that I can't seem to diagnose or make go away. I've reduced it to the simplest case, and I'm still seeing the problem. My code:
import groovy.sql.Sql
def bodyText
def sql = Sql.newInstance("jdbc:oracle:thin:@192.168.X.Y:1521:hostname",...
Dear All:
I have some Java code that seemed to work fine:
/**
* Helper method
* 1. Specify args as Object[] for convenience
* 2. No error if method not implemented
* (GOAL: Groovy scripts as simple as possible)
*
* @param name
* @param args
* @return
*/
Object invokeGroovyScriptMethod(String name, Object[] args) {
Object...
My main question here is dealing with the pramas map when having a one-to-many relationship managed within one dynamic form, as well as best practices for dealing with one-to-many when editing/updating a domain object through the dynamic form. The inputs for my questions are as follows.
I have managed to hack away a form that allows me ...
I'm converting a table with the Criteria plugin to filter it to a GrailsUI
datatable .. My plan was to try and utilize the Criteria builder as a kind of
engine and supply the HQL it generates as a filter to my datatable .. It's
going okay BUT i'm now left with a string which looks like ..
filterOn={member.list={members={criteria={pro...
Does anybody know if it is possible create and write to polymorphic join tables using grails.
Are there any drawbacks from doing this
...
I've been programming in Java for the last few years, but due to disappointment with the current state of the language I'd like to switch to another JVM language with all the goodies of dynamic languages and features like closures, etc. I've looked around and Scala and Groovy seem the most popular choices. Am I missing other good languag...
I've been trying out the easyb BDD framework for about a day and a half and I'm not sure I understand the difference between a story and a specification(besides the syntax). A story uses the given, when, then syntax and a scenario uses the description, it, it... syntax.
Besides the syntax is there a difference between the two?
Is u...