Can't compile with FileFactory.newInputStream

General discussion on the JZOS batch launcher and toolkit
Post Reply
Posts: 18
Joined: Thu Jan 17, 2013 1:46 pm

Can't compile with FileFactory.newInputStream

Post by EarlHodil » Fri Jan 18, 2013 2:32 am

I'm sure this is something stupid, but I've looked at it for two hours now and can't see it. I can't seem to get my program to compile using newInputStream. I have the ibmjzos.jar and jzos.jar files in my CLASSPATH, and I have the import*; Still no love.

Here's the code:

Code: Select all


import java.text.ParseException;
import java.text.SimpleDateFormat;

public class ProdAuth {
	private static long TENDAYS = 10*24*60*60*1000;
	public static void main(String[] args) throws Exception, UnsupportedEncodingException, ParseException {
	public static void loadAuth() {
    	try {
            //load a properties file
    		Properties prop = new Properties();
    		InputStream in = 
            //get the property value and print it out
    	} catch (IOException ex) {
And here's what I get when I use Ant to compile:

Code: Select all

     [echo] Classpath=/Users/ehodil/Documents/workspace/Memocast/lib/OSinfo.jar:/Users/ehodil/Documents/workspace/Memocast/lib/base64coder.jar:/Users/ehodil/Documents/workspace/Memocast/lib/ibmjzos.jar:/Users/ehodil/Documents/workspace/Memocast/lib/jzos.jar:/Users/ehodil/Documents/workspace/Memocast/lib/submit.jar
    [javac] /Users/ehodil/Documents/workspace/Memocast/deploy.xml:39: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to /Users/ehodil/Documents/workspace/Memocast/bin
    [javac] /Users/ehodil/Documents/workspace/Memocast/src/com/OST/memocast/ cannot find symbol
    [javac] symbol  : class newInputStream
    [javac] location: class
    [javac]     				new"//DD:AUTHPROP");
    [javac]     				                            ^
    [javac] 1 error
I have quadruple checked my spelling. What am I doing wrong?

Site Admin
Posts: 1886
Joined: Thu Jul 29, 2004 12:12 pm

Re: Can't compile with FileFactory.newInputStream

Post by dovetail » Fri Jan 18, 2013 4:02 pm is a static method, not a constructor.
So, you shouldn't have "new".

Also, if you use newInputStream you will read the dataset in binary.
If you use Properties.load(InputStream), the data is expected to be in ASCII (ISO8859-1).

So, you might want to use one of the FileFactory static methods that returns a Reader (BufferedReader).

Posts: 18
Joined: Thu Jan 17, 2013 1:46 pm

Re: Can't compile with FileFactory.newInputStream

Post by EarlHodil » Sat Jan 19, 2013 8:58 am

Thanks that worked (the newBufferedReader, that is).

Post Reply