I get Spooled list to java using jt400. but i want to get Advanced Spooled file( *.TIFF image formatted Spooled files) list and normal Spooled (Can read Text) file list separately. Anyone know how to do that ?

Thanks in Advance!

                    try{
      


         AS400 server = new AS400();
        System.out.println(" Now receiving all spooled files Synchronously");

        SpooledFileList splfList = new SpooledFileList( server );

        // set filters, all users, on all queues
        splfList.setUserFilter("user");
        splfList.setQueueFilter("/QSYS.LIB/%ALL%.LIB/%ALL%.OUTQ");



        // open list, openSynchronously() returns when the list is completed.
        splfList.openSynchronously();
       // Enumeration enum = splfList.getObjects();
        Enumeration enumx = splfList.getObjects();

        while(enumx.hasMoreElements())
        {
            SpooledFile splf = (SpooledFile)enumx.nextElement();
        
            if ( splf != null )
            {
                
               String Name = splf.getName();
               int Number = splf.getNumber();
               String jobname = splf.getJobName();
               String jobuser = splf.getJobUser();
               String jobnumber = splf.getJobNumber();
              //  strSpooledNumber = splf.getStringAttribute(SpooledFile.)
                System.out.println(" spooled file = Name :" + Name + " number : " + Number + " JobName : " + jobname + " job user : " + jobuser + " job Number : " + jobnumber);
            }
        }
        // clean up after we are done with the list
        splfList.close();
    }
    catch( Exception e )
    {
       
        e.printStackTrace();
    }
有帮助吗?

解决方案

The existing class doesn't have a filter on printer device type, although you could add one using getUserFilter as an example.

Once you have the full list of spooled files, you could split them yourself into two groups. Try String prtdevtype = splf.getStringAttribute(ATTR_PRTDEVTYPE);

From this you can tell if you have a text spooled file (*SCS) or one with graphics in it (*IPDS, *AFPDS).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top