Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, June 27, 2011

ant buildfile

I am not too familiar with ant, but today I successfully managed to modify someone's ant buildfile to see my  very own files:

The original file had this:

<path id="compile.classpath">
                <fileset dir="${lib}">
                        <include name="weka.jar"/>
                        <include name="postaipc-0.8.5.jar"/>
                        <include name="clipc-0.2.jar"/>
                </fileset>
        </path>

and I simply modified it to:

<path id="compile.classpath">
                <fileset dir="${lib}">
                        <include name="weka.jar"/>
                        <include name="postaipc-0.8.5.jar"/>
                        <include name="clipc-0.2.jar"/>
                </fileset>
                <pathelement location="/home/me/myfiles"/>
        </path>

Thursday, June 23, 2011

Using System.out.print(ln?)()

I often use System.out.println and its sister, System.err.println.

However, I'd like to be able to easily switch the type of output my program emits, between not just stdout and a file, but also different formats, each of which would subclass BufferedWriter in order to produce the write format.

I don't know though, because then I'm either trying to return strings from each of my classes, or each class has to have access to the output stream, or I end up passing the output stream around a lot.