Synchronous Read of files within FlowN structure

Hello again,
I was wondering whether it would be possible to do a number of synchronous reads within a FlowN structure. Essentially, I have a list of file names which I want to loop through. For each file name, I then want to invoke a synchronous file read on that file, and then extract some data to put into my results structure.
Is this possible?
Thanks in advance.
Adam

Hi giovanni,
Instead of trying to read the file read use an input stream. Something like this;
URL theURL = classLoader.getResource(myConfig.xml);
InputStream is = theURL.openStream();
// read the streamalternatively you could use getResourceAsStream on the class loader.
Hope this helps.
-bd-
http://bill.dudney.net/roller/page/bill

Similar Messages

  • Synchronous Read in File Adapter

    Hi,
    Could you please explain one example scenario for Synchronous Read in File Adapter?
    Thanks,
    kpr

    This is end to end case
    Assume u have file coming from 2 differnt source in 2 differet inbound file adapter you can read this at a same time and do assign,transform etc in bpel and send one file to next process for further processing. in this type of scenario we use a Sync file read
    Note: the 2 files come at same time to inbound file adapter.

  • Is it possible to read Prezi files within the iOS app?

    Hello,
    I want to implement Prezi into my iOS app. I am totally unaware that "Is it possible to read Prezi files within the iOS app?".
    If Yes, please provide some tutorial link, so that I can implement into my application.
    Thanks & regard.

    You will get a better answer in
    Developer Forums
    Use your Developer credentials to log in there.

  • I removed chrome 10 and newly installed FF4 final, and I can't read PDF files within the browser. There was no problem in Chrome.

    I removed chrome 10 and newly installed FF4 final, and I can't read PDF files within the browser. There was no problem in Chrome. I can't even see the acrobat reader plugin in the plugins page. Acrobat 10 is already installed in my PC. Every time I try to read a PDF file on the web, FF tries to download it instead.

    As recommended above by Bernd Alheit, I posted this on the Adobe Reader forum. There, I received the advice to repair the installation under the help menu, which I did and it fixed the problem.
    Similar to your solution but found it's a fix found under "HELP" menu and not Add/Remove.
    Thank you.

  • Can sender file adapter read plain files with different structure?

    Hej experts,
    I am facing the following sutiation in FIle-to-Mail scenario:
    Bank sends two types of file : CONTRL and BANSTA to the same directory where XI shall  pick , map to other stucture  (mail structure ) and send mail.
    You can not identify the file type( CONTRL or BANSTA) from file name - only from file content.
    Would it be possible for XI to pick up file, check the structure and select the right XML structure to transform to?
    Any other solutions?
    Thak you for your help,
    Natlaiya

    You can not identify the file type( CONTRL or BANSTA) from file name - only from file content.
    Would it be possible for XI to pick up file, check the structure and select the right XML structure to transform to?
    If not wrong even XI/ PI cannot understand it.....if you say you can implement an adapter module to do the file conversion....even in that case you will need to know the file format....do you need to implement any conversion on the file?
    Regards,
    Abhishek.

  • Static method to read text file within JAR.

    I've a small problem. I've got my JAR file stuff working great, so I thought I'd give a go to running it via WebStart. Through a little research, I've found that if you're distributing your application via WebStart, you need to pack up everything in a JAR file. This is no problem for the JDBC drivers, because its already in a JAR, so I should be able to distribute that fine.
    I've managed to digitally sign my application JAR and have a preliminary (i.e. untested) JNLP file set up.
    My problem is, my application gets its available data sources from an external text file. I've already written my own file I/O class which I use in my "commonfiles" package to read in a text file and return it as an array with each element holding a line from the text file. This class is basically just a bunch of static methods.
    So instead of rewriting this, I thought I'd just add a boolean flag to this method to state whether to load this file from the external file system or the JAR file. I've found out that to load a text file from within the JAR you have to use something like: -
    String str = (this.getClass().getResource("/myData.txt")).getFile();
    java.io.File fil = new java.io.File(str);
    java.io.FileReader fr = new java.io.FileReader (fil);
    java.io.BufferedReader bin = new java.io.BufferedReader (fr) ;The sticking point is that my method (ReturnFileAsArray()) is declared as static, because my own FileIO class is just a bunch of static methods to do file I/O stuff. Therefore, I can't use the above method because of the instance variable "this" (I assume).
    Is there any way I can load an included text file as above without having to declare my method as an instance method? I guess I could write a seperate class to do this for my commonfiles package, but I'd rather not if possible.
    Any ideas?

    Don't put a "flag" and code different ways to read files depending on whether it's in a JAR or not. Just use
    the getResource/getResourceAsStream API regardless. Hmmm.....so that will load it from either place depending on the situation? I keep getting a NullPointerException doing that, on this line: -
    String strFileName = (FileIO.class.getResource(fileName)).getFile();...although I've only tried it using the external local filesystem file (in the same directory) as I've not really finished setting up my WebStart stuff yet.
    Here is the method in question...
    public static String[] ReadFileAsArray(String dirName, String fileName, boolean bFromJAR) {
            String[] resultStringArray = null;
            StringBuffer strBuffer = null;
            StringTokenizer strTokenizer = null;
            FileReader fReader = null;
            BufferedReader bReader = null;
            int iElementCount = 0;
            if ((dirName.length() < 1) || (fileName.length() < 1)) {
                // Null parameters found. Failure.
                return null;
            } else {
                // Parameters correct, continue.
                try {
                    // Read the file contents and convert to String array.
                    //if (bFromJAR) {
                        // Open file from within JAR file.
                        String strFileName = (FileIO.class.getResource(fileName)).getFile();
                        File jarFile = new File(strFileName);
                        fReader = new FileReader(jarFile);
                    //} else {
                        // Open from local filesystem.
                    //    fReader = new FileReader(dirName + File.separator + fileName);
                    bReader = new BufferedReader(fReader);
                    strBuffer = new StringBuffer();
                    while (bReader.ready()) {
                        strBuffer.append(bReader.readLine() + "%%");
                    strTokenizer = new StringTokenizer(strBuffer.toString(), "%%");
                    resultStringArray = new String[strTokenizer.countTokens()];
                    while ((strTokenizer.hasMoreTokens()) && (iElementCount < resultStringArray.length)) {
                        resultStringArray[iElementCount++] = strTokenizer.nextToken();
                    bReader.close();
                    return resultStringArray;
                } catch (IOException e) {
                    return null;
        }I'm calling it using: -
    // Load the external file into a String array, one row for each element.
    String[] fileArray = FileIO.ReadFileAsArray(System.getProperty("user.dir"), "datasources.dat", true);Cheers on any info on this.

  • Can't read any file within a disk image

    A year ago I created a disk image with a few thousand files in as an archive. Periodically I open it and access the files.
    Now when I open the dmg, I see all the folders and files, but none of them are usable. No application can open them, for example opening a jpg in Preview yields the message " The file “Picture 1.jpg” could not be opened. It may be damaged or use a file format that Preview doesn’t recognize. " I get similar meesages from Word, Acrobat, etc. for their files. Basically it appears that every file in the dmg is corrupt.
    I have run Disk Utility Repair which said no repair needed; I have run DiskWarrior which found and fixed problems; neither made a difference.
    Any suggestions? Running 10.6.8.
    Thanks

    Sorry that I'm late to this party, but in case somebody else comes by this thread, this is the way to measure the voltage from the 20V plugs:
    http://www.kawakami-ca.com/images/20v_dc_plug.jpg
    Ray Kawakami
    X22;X24;X31;X41;X41T;X60;X60s;X61s;X300;X301;Z60m;Z61t;Z61p;560Z;600E;600X;T21;T22;T23;T41;R50;A21p;A22p;A31 and A31p
    Not a Lenovo employee; just a volunteer helping out here
    All personal links to PC-Doctor software removed 8/2012 by mfg request

  • How synchronous read operation is outbound operation?

    Hello,
    1. what is the difference between read and synchronous read in file adapter?
    2. how synchronous read operation is outbound operation? Read must be an Inbound operation.
    Please clarify.
    Thanks in adv,
    kpr
    Edited by: 975937 on Dec 13, 2012 8:44 PM

    1. what is the difference between read and synchronous read in file adapter? Read is use for polling. Read option will initiate a new instance(and you will use a receive activity - inbound).
    2. how synchronous read operation is outbound operation? Read must be an Inbound operation. Synchronous read is being used from an existing instance (process). You will use an invoke activity for that - you are sending a request to read a file (file/directory name etc..). You are then getting back the result (file content etc....).
    Hope that answered your question.
    Arik

  • How to read a file with data in Hierarchical Structure using XSD Schema

    Hi
    We have requirement in which we have to read a FIXED LENGTH file with FILE ADAPTER. File contains the data in hierarchical structure. Hierarchy in the file is identified by the first 3 characters of every line which could be any of these : 000,001,002,003 and 004. Rest files are followed after these. So structure is like:
    000 -- Header of File. Will come only once in file. Length of this line is 43 characters
    -- 001 -- Sub Header. Child for 000. Can repeat in file. Length of this line is 51 characters
    --- 002 -- Detail record. Child for 001. Can repeat multiple times in given 001. Length of this line is 43 characters 1353
    -- 003 -- Sub Footer record at same level of 001. Will always come once with 001 record. Child for 000. Length of this line is 48 characters
    004 -- Footer of file.At same level of 000. Will come only once in file. Length of this line is 48 characters
    Requirement is to create an XSD which should validate this Hierarchical Structure also i.e data should come in this hierarchy only else raise an error while parsing the file.
    Now while configuring the FILE ADAPTER to read this file we are using Native Schema UI to create the XSD to parse this structure using an example data file. But we are not able to create a valid XSD for this file which should validate the Hierarchy also on the file.
    Pls provide any pointers or solution for this.
    Link to download the file, file structure details and XSD that we have created:
    https://docs.google.com/file/d/0B9mCtbxc3m-oUmZuSWRlUTBIcUE/edit?usp=sharing
    Thanks
    Amit Rattan
    Edited by: user11207269 on May 28, 2013 10:16 PM
    Edited by: user11207269 on May 28, 2013 10:31 PM
    Edited by: user11207269 on May 28, 2013 10:33 PM

    Heloo.. Can anyone help me on this. I need to do Hierarchial read / validation while reading the file using File Adapter using Native XSD schema.

  • How to read/unzip a specific file within a zip file

    Hi,
    I have a file within a zip file that contains a timestamp - I want to read this timestamp and then create a destination directory for the remaining zip files to be unzipped into. Since I know the name of the file with the timestamp in it I thought I could create a zipfile and use getEntry to get the entry but then other than getting the size and name of the file I can't do much more with it like read it unless I use a stream (zipinputstream) instead of a file (zipfile) - do I have this right?
    Does this mean to get the content I would have to loop through possibly all the files using the stream until I come across the one I want - then get the timestamp and loop through them all again to write them to the destination directory? Or am I reading this wrong - seems a bit round about.
    Any suggestions would be greatly appreciated.
    Thanks

    this works though - and you don't have to loop through all the files - just use the ZipFile:
    ZipEntry ze = zipfile.getEntry("path/to/file");
    BufferedReader br = new BufferedReader(new InputStreamReader(zf.getInputStream(ze)));
    line = br.readLine;Thanks!

  • Synchronous read file and status update

    Hi,
    CSV file to be loaded into the database table. ASP used as front end and ESB should be used for backend processing!
    A csv file is placed in a fileshare by an asp page. After that a button is clicked on the asp page which inserts a record into a database table(A) with the file details. There is a flag field in the table which will be set to 'F' initially.
    Now there should be an esb service which will be polling for any new records inserted into the database table(A).
    Once it finds any new record, the esb service should update the flag status to 'RF' from 'F' and read the records in the csv file(I think synchronous read file should be used inthe file adapter) and insert them into a database table(B). The flag field is updated to 'RF' so that the asp page informs the user that the csv file is being inserted into the table(B).
    After all the records are inserted, the esb service should once again update the flag in table(A) to 'Y' from 'RF' so that the asp page will indicate the user that the csv file is loaded into the data base table.
    The challenges that I have here are:
    1) I need to have the ESB service with such a sequence of execution that updates the table(A) at each stage so that the asp page can display the status to the USER.
    2) The csv file size can be huge. It can contain as many as 100 thousand records with over 50 fields in each record. I will have to probably debatch the file. Once we debatch, seperate instance would be created for each batch. Now we should see to that flag in table(A) is updated to 'Y' only when the last batch of the records are processed.
    I am using jdev10134 and oracle SOA suite ESB10134
    Someone please advice on how to go ahead.
    Cheers,
    RV

    Hi,
    CSV file to be loaded into the database table. ASP used as front end and ESB should be used for backend processing!
    A csv file is placed in a fileshare by an asp page. After that a button is clicked on the asp page which inserts a record into a database table(A) with the file details. There is a flag field in the table which will be set to 'F' initially.
    Now there should be an esb service which will be polling for any new records inserted into the database table(A).
    Once it finds any new record, the esb service should update the flag status to 'RF' from 'F' and read the records in the csv file(I think synchronous read file should be used inthe file adapter) and insert them into a database table(B). The flag field is updated to 'RF' so that the asp page informs the user that the csv file is being inserted into the table(B).
    After all the records are inserted, the esb service should once again update the flag in table(A) to 'Y' from 'RF' so that the asp page will indicate the user that the csv file is loaded into the data base table.
    The challenges that I have here are:
    1) I need to have the ESB service with such a sequence of execution that updates the table(A) at each stage so that the asp page can display the status to the USER.
    2) The csv file size can be huge. It can contain as many as 100 thousand records with over 50 fields in each record. I will have to probably debatch the file. Once we debatch, seperate instance would be created for each batch. Now we should see to that flag in table(A) is updated to 'Y' only when the last batch of the records are processed.
    I am using jdev10134 and oracle SOA suite ESB10134
    Someone please advice on how to go ahead.
    Cheers,
    RV

  • Reading a csv file within a for loop

    Hi guys,
    Im trying to read a csv file within a for loop and the while loop only seems to be getting executed once rather than the number of times that is specified.
    for(int i=0; i<paramValues.length;i++)
    String StudentNo = paramValues4;
    out.println("StudentNo="+StudentNo);
    BufferedReader in = new BufferedReader( new InputStreamReader( conn2.getInputStream()));
    String readLine;     // stores a line from the file as a string//used to get rid of the first line which has course name
                                                      readLine = in.readLine();
                                                                     int NumberOfElementsInArray=16;
                                                           String[] data;
                                                                     data = new String[NumberOfElementsInArray];
                                                                     data[0]=> StudentNo
                                                                     data[1]=> Surname
                                                                     data[2]=> Firstname
                                                                     data[3]=> ExamNo
                                                                     data[4]=> YrOfStdy
                                                                     data[5]=> ProgOfStdy
                                                                     data[6]=> Fld1
                                                                     data[7]=> Fld2
                                                                     data[8]=> DegType
                                                                     data[9]=> EnrolStatus
                                                                     data[10]=> StaffAdvNo
                                                                     data[11]=> Tutor
                                                                     data[12]=> Fld3
                                                                     data[13]=> Fld4
                                                                     data[14]=> Fld5
                                                                     data[15]=> Pegged
                                                                     data[16]                                                            
                                                                     //out.println("<table border=\"1\">");
                                                                     int datanumber=0;
                                                                     while( (readLine = in.readLine()) != null )     
                                                                          out.println("ive entered the loop");                                                       
                                                                          StringTokenizer tokens = new StringTokenizer( readLine, ",", true);                    
                                                                          boolean prevTokenComma = true;
                                                                          boolean emptyValue = false;
                                                                          String aValue = null;
                                                                          datanumber=0;                                                                      
                                                                          while( tokens.hasMoreTokens() )          
                                                                               aValue = null;
                                                                               String token = tokens.nextToken();
                                                                               token=token.trim();
                                                                               //if the token does not equal to a comma
                                                                               if( !token.equals(",") )               
                                                                                    aValue = token;                    
                                                                                    prevTokenComma = false;                    
                                                                                    emptyValue = false;     
                                                                               else if( token.equals(",") && prevTokenComma )               
                                                                                    prevTokenComma = true;                    
                                                                                    emptyValue = true;               
                                                                               else //( token.equals(",") && !prevTokenComma )               
                                                                                    prevTokenComma = true;                    
                                                                                    emptyValue = false;
                                                                               if(emptyValue)
                                                                                    aValue = "";
                                                                               // Printing values
                                                                               if( aValue == null)
                                                                                    //do nothing
                                                                               else if (aValue.equals("") )
                                                                                    aValue="&nbsp";
                                                                                    data[datanumber]=aValue;
                                                                                    //out.println("datanumber="+datanumber);
                                                                                    //out.println("<td> aValue: "+aValue+"</td>");
                                                                                    datanumber++;
                                                                               else
                                                                                    data[datanumber]=aValue;
                                                                                    //out.println("<td> aValue: "+aValue+"</td>");
                                                                                    //out.println(datanumber);
                                                                                    datanumber++;                                                                                
                                                                          out.println("data[0]="+data[0]);
                                                                          //out.println("data[3]="+data[3]);
                                                                          //out.println("ExamNo="+ExamNo);
                                                                     }//end while
                                                                     in.close();
    }//end for loop
    When I print the variable student no at the beginning of the for loop it prints the different studentno's so the for loop is fine, but the while loop gets executed once. Does anyone know why????????/
    Thanks
    Tzaf

    PROBLEM SOLVED....
    Basically the following declarations have been done within the for loop....
    URL url2 = new URL ("http://localhost:8080/FYP/CSVFILES"+Year+"/"+WebCourse2+".csv");
                                                                     URLConnection conn2 = url2.openConnection();
                                                                     HttpURLConnection uc = (HttpURLConnection)conn2;
                                                                     uc.connect();
                                                                     try
                                                                          responseCode = uc.getResponseCode();
                                                                          out.println("Response code1: " + responseCode+"\n");
                                                                     catch(IOException e)
                                                                          responseCode = uc.getResponseCode();
                                                                          //out.println("Response code2: " + responseCode+"\n");
    thanks
    anyway
    tzaf

  • Camera raw 7.2 will not install within CS5.5, but need it to read nrw files from P7700.

    camera raw 7.2 will not install within CS5.5, but need it to read nrw files from P7700. Besides DNG Converter, what can I do to use files directly?

    Your next option is to upgrade photoshop. If you can't afford the full version (less than $20/month) you could get elements, it uses the latest version of camera raw, but I think it is a stripped down version though.

  • Passing file name dynamically in Synchronous read operation of FTP adapter in OSB

    Hi,
    We are implementing the integration in OSB 11g and using FTP JCA adapters to check if the file exists in the FTP location or not. We are using Synchronous read operation of FTP adapters. We need to pass the file name dynamically at run time. In the JCA file we can hard code the file name. How that file name can be taken dynamically using OSB.
    Regards,
    Sharmistha

    Hi Sandeep,
    This is possible.
    For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    In the case of receiver file adapaters, you have 5 options for file creation like,
    1.Create
    2.Append
    3. Add time stamp
    4.Add Counter
    5. Add Message ID
    You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Hope this helps

  • Adobe Reader plugin :This sentence "le fichier ne commence pas par '%PDF-'" appears when I try to open some (not all) PDF files within Firefox (does not happen when I download the file)

    This sentence (in french version) "le fichier ne commence pas par '%PDF-'" appears when I try to open some (not all, mainly bigger than 1Mo) PDF files within Firefox (does not happen when I download the file)

    You mention Thunderbird, has the PDF file been emailed to you? If it has this support page from Adobe may help - http://www.adobe.com/fr/support/toptech/acrobat/319294/

Maybe you are looking for

  • How can I provide Horizontal tool bar at the bottom of the form?

    Hi Friends, I have form with 8 tab pages. I created a horizontal toolbar canvas with some navigational buttons. I want to put the horizontal toolbar at the bottom of the form which is common to all of my tab pages of that particular form. How can I d

  • Automatic creation of Maintenance Order

    Hi,      I have created the maintenance plan. I have scheduled the plan. How can the maintenance order get created automatically as it is not possible for the users to check on daily basis. Thanks in advance. Regards, Maheswaran

  • How can i copy and paste on my macbook pro

    how to copy and paste on my macbook pro

  • "Unplugging" MacBook Pro?

    Excuse this probably-dumb question, I'm new both to the world of Mac and to the world of laptops (I've always had desktops in the past): Background: I use my new MacBook Pro on my desk at home 90% of the time, as though it were a desktop. I have a wi

  • The # sign is part of db field names

    I'm using an odbc to a database where the # sign is part of the field name. I have researched it and found that suggested solutions don't work. Anyone know of a workaround for a field name ISREC#