Reading ampersand from directory path

I've searched these forums and google to no avail on this problem.
I'm trying to read in directory paths through a JSP and here is my code to do this:
String dirName;
dirName = request.getParameter("dirName");
if ( dirName == null ) dirName = "";
System.out.println("dirName = " + dirName);
The problem I'm having is if a (Windows) directory name contains an ampersand (i.e. AT&T) - the output is: 'dirName = AT' and so the string cuts off at the ampersand. Is there any way to recognize this character?

Thanks for the quick response.
I sub'd in the following now:
dirName = request.getParameter(URLEncoder.encode("dirName"));
However, the ampersand still is not being encoded as %26 (even though spaces in directory names are encoded as %20). What my JSP does is make directory names links which allow a user to click through them to view the contents. Here's the code I'm using to do this which is within a loop and the i gets incremented (this all works - except for the case where the directory name has an &):
<a href="search.jsp?dirName=<%= path[ i  %">"><%= path[ i ] %></a><br>
Any ideas? TIA
</a>

Similar Messages

  • "Failed to load main class manifest attribute from " directory path

    i get this error when trying to run a jar file i made with eclipse. does anyone know how to fix it? thanks derek
    "Failed to load main class manifest attribute from "<directory path>

    A JAR file is simply a collection of class files, in order to make it an "executable" JAR file you must specify which class file is the "main" class file. In other words, which class should the runtime start executing first. You do this using what is called a manifest file, this is meta information included into the JAR file that the runtime extracts and uses. One attribute is the Main-Class key, which specifies the application's entry point.
    The Java tutorial goes into further detail on how to do this
    http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html
    You may also do this using Eclipse by going File -> Export -> Java -> JAR and follow the wizard.
    Using Netbeans this almost comes for free.

  • Read file from directory, update contents of the each file

    hai,
    I could not understand how to debug the error i have now.
    target
    1- read the files from directory // i able ot do this part
    2- for each file
    for each file read the content & compare with the existing List & update the list // i able to do this part
    when i try to combine both parts , i got some following error
    run:
    E:\java\check\100130.ixf
    Error: children[i] (The system cannot find the file specified)
    BUILD SUCCESSFUL (total time: 2 seconds)
    i can see from the code that children[i] only gives the error when i use that in the second part of the code.
    can any one help me on this??
    Thanks
    Priyan
    the original code
    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStreamReader;
    import java.io.RandomAccessFile;
    import java.util.ArrayList;
    public class CompareList
         public static void main(String[] args){
             ArrayList a1 = new ArrayList();
             ArrayList a2 = new ArrayList();
             a1.add("1");
             a1.add("2");
             a1.add("3");
             a1.add("4");
             a1.add("5");
             a1.add("6");
             a1.add("7");
             a1.add("8");
             a1.add("9");
             a1.add("10");
             a1.add("11");
             a1.add("12");
             a1.add("13");
             a1.add("14");
             a1.add("15");
             a1.add("16");
             a1.add("17");
             a1.add("18");
             a1.add("19");
             a1.add("20");
             a1.add("21");
             a1.add("22");
             a1.add("23");
             a1.add("24");
             a1.add("25");
             a1.add("26");
             a1.add("27");
             a1.add("28");
             a1.add("29");
             a1.add("30");
             a1.add("31");
             a1.add("32");
             a1.add("33");
             a1.add("34");
             a1.add("35");
             a1.add("36");
             a1.add("37");
             a1.add("38");
             a1.add("39");
             a1.add("40");
             a1.add("41");
             a1.add("42");
             a1.add("43");
             a1.add("44");
             a1.add("45");
             a1.add("46");
             a1.add("47");
             a1.add("48");
             a1.add("49");
             a1.add("50");
             a1.add("51");
             a1.add("52");
              try{
                    File dir = new File("E:\\java\\check");
                    File[] children = dir.listFiles();
                    if (children == null) {
                          System.out.println("does not exist or is not a directory");
        else {
               for (int i = 0; i < children.length; i++) {
                       System.out.println( children);
    FileInputStream fstream = new FileInputStream("children[i]");
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String strLine;
    while ((strLine = br.readLine()) != null)      {
    String line =strLine.substring(0,2);
    // Print the content on the console
    //System.out.println(line);
    a2.add(line);
    } // end of add list2
    if (a1.size() > a2.size())
    int k = 0;
    for (int l = 0; l < a2.size(); l++)
    if (!((String)a1.get(l)).equals((String)a2.get(l)))
    //System.out.println((String)a2.get(i));
    // System.out.println("dd");
    k = l;
    k++;
    for (int l = k; l < a1.size(); l++)
    System.out.println((String)a1.get(l));
    String str = "children[l]";
    File file = new File(str);
    RandomAccessFile rand = new RandomAccessFile(file,"rw");
    rand.seek(file.length()); //Seek to end of file
    rand.writeBytes((String)a1.get(i)); //Write end of file
    rand.writeBytes("., 0.");
    rand.writeBytes("\n");
    }// end of comparing and updating the list2
              in.close();
    catch (Exception e){//Catch exception if any
    System.err.println("Error: " + e.getMessage());

    thanks for the information.
    i tried, the error
    like this
    run:
    E:\java\check\100130.ixf
    java.lang.StringIndexOutOfBoundsException: String index out of range: 2
            at java.lang.String.substring(String.java:1935) 
            at CompareList.main(CompareList.java:84)
    BUILD SUCCESSFUL (total time: 0 seconds)this comes because in my code i used children[i] as string in the later part
        else {
               for (int i = 0; i < children.length; i++) {
                        System.out.println( children);
    FileInputStream fstream = new FileInputStream(children[i]);
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String strLine;
    while ((strLine = br.readLine()) != null)      {
    String line =strLine.substring(0,2);
    a2.add(line);
    System.out.println(line);
    } // end of add list2
    if (a1.size() > a2.size())
    int k = 0;
    for (int l = 0; l < a2.size(); l++)
    if (!((String)a1.get(l)).equals((String)a2.get(l)))
    //System.out.println((String)a2.get(i));
    // System.out.println("dd");
    k = l;
    k++;
    for (int l = k; l < a1.size(); l++)
    System.out.println((String)a1.get(l));
    String str = "children[l]";
    File file = new File(str);
    RandomAccessFile rand = new RandomAccessFile(file,"rw");
    rand.seek(file.length()); //Seek to end of file
    rand.writeBytes((String)a1.get(i)); //Write end of file
    rand.writeBytes("., 0.");
    rand.writeBytes("\n");
    rand.close();
    }// end of comparing and updating the list2
              in.close();
    i stil could not figure out it yet. do u have any clue with this.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to read data from info path in custom web part in share point 2010

    We have a document library where the some info paths (code info paths) are uploaded with different views. Is there any way to read the data from info paths forms in custom share point 2010 web parts like  using any available  web services in share
    point 2010 etc,,
    Any suggestions are helpful to me.
    TARUN

    Hello,
    Yes, you can use XmlDocument, XmlNodeList, XmlElement, XmlNode etc to read infopath file via code. Just add "using System.Xml" as reference in your solution.
    Refer below link with sample code:
    https://sujeewaediriweera.wordpress.com/2012/02/12/accessing-infopath-form-data-programmatically/
    http://sharepoint2010tutor.blogspot.sg/2012/01/programmatically-reading-contents-of.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Read .xls from specific path in host server in flex 4.5 using As3xls?

    Hi Guys
    I am New to flex programming and I have some doubts regarding exporting data from excel file to flex
    1) Is there a way of reading excel file from a specific path in host server in flex 4.5 using as3xls?
        i.e is I want to read a flex file from a specific path in the computer.
    2)Is there a way of reading excel file from a specific location in a website?
    I have been trying find a solution to this for a long time but have hit a dead end. any kind of solution will be really helpful. Thanks in advance.
    Regards
    Vivek Mangalam

    Someone suggested it could be a serialisation issue but I I'm not sure how to go about checking that.
    Any suggestions ?

  • Urgent: read pdfs from network path?

    Hi friends,
    I have a probem:
    When I try to read a pdf (which is in a local network path) my applicattion does it ok only if I've logged on windows as administrator user in my PC, but it doesn't work if I try to log with another user... Any idea?
    Can I solve this question modifying my forms application? (How??) or it's only a windows permissions problem?
    Thanks
    Jose

    I can think of two ways to set the permissions. One is with HOST and then a command-line tool to set the permissions. I think there was something like that in the NT/Windows Resource Kits. The other one would be to use ORA_FFI and call a DLL that can set the permissions for you.
    But in either ways, you're doing these modifications using the currently logged on user. If the problem is that this user doesn't have access to the file, he/she cannot set the security settings either. You would have to set the access permissions on creation of the file.
    But you not just set the default permission of the directory in such a way that any newly created file gets the correct permissions?
    One last resort would be to schedule a script through the "at" command at scheduled intervals under a 'superuser" that will set the correct permissions.

  • How to play a video from directory path

    I'm not able to play a video while clickng the play button. It was appering a black screen while chilckng the button. y this was happening please help me im new to ios..

    Hi,
    To retrieve the data from database, I suggest that you could use DAO and you could iterate the records.
    There is a link about RecordSet of DAO that can help you:
    # Database.OpenRecordset Method (DAO)
    https://msdn.microsoft.com/en-us/library/office/ff820966.aspx?f=255&MSPPError=-2147217396
    For this requirement of play video, I suggest that you could create a new form, then add the Windows Media Player ActiveX control to the form.
    You could set the value to URL property to specify the media file. To full screen the player, you could set
    fullScreen to True.
    For the issue of play one after another or play a video through VBA, they are more related to VBA, the VBA forum is the better place for VBA questions, I suggest that you could post it there for solutions.
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Read file from directory

    Hi all,
    CALL 'C_DIR_READ_START'  ID 'DIR'    FIELD P_DIR
                              ID 'FILE'   FIELD IT_FILEDIR-FILENAME
    IF SY-SUBRC <> 0.
    WRITE:/ 'Incorrect File'.
    EXIT.
    ENDIF.
    This is my code for read particular file in server.
    Iam passing p_dir and filename correctly .but this statement still failing .Can any one help me in this issue?

    Please see the following sample program for viewing the application server file system and reading the files into your ABAP program.
    report zrich_0001 .
    data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    data: wa(1000) type c.
    data: p_file type localfile.
    data: ifile type table of  salfldir with header line.
    parameters: p_path type salfile-longname
                        default '/usr/sap/TST/DVEBMGS01/data/'.
    call function 'RZL_READ_DIR_LOCAL'
         exporting
              name           = p_path
         tables
              file_tbl       = ifile
         exceptions
              argument_error = 1
              not_found      = 2
              others         = 3.
    loop at ifile.
      format hotspot on.
      write:/ ifile-name.
      hide ifile-name.
      format hotspot off.
    endloop.
    at line-selection.
      concatenate p_path ifile-name into p_file.
      clear itab.  refresh itab.
      open dataset p_file for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset p_file into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset p_file.
      loop at itab.
        write:/ itab.
      endloop.
    REgards,
    Rich Heilman

  • Does not read from the path in default.env

    Hi All,
    I have given the path of my forms directories in default.env for my 10gDS Suite. While running it does not read it from the path that I have provided in that file. I also specified the same path in registry still the same error. The error message reads like FRM-18108: Failed to load the following objects.
    Any help will be appreciated.
    Thanks.

    Ok, I'm stumped!
    I thought I would see what would cause the Forms Builder to fail opening an fmb, so I changed my FORMS_PATH value in the default.env file by removing the second directory listed there. Opening a form in the builder gave me two errors:
    FRM-18108: Failed to load the following objects. (Listed the objects in our Ref form.)
    FRM-10102: Cannot attach PL/SQL library...
    Then I changed the FORMS_PATH back, but now, I am unable to open a form without those errors in the Forms Builder.
    My forms_path line looks like this:
    FORMS_PATH=C:\oracle\DevSuiteHome_1\forms;C:\Users\Steve\01\fmb10The only thing I can do now to get a form to open without the errors is to copy the reference fmb and the PLL library from C:\Users\Steve\01\fmb10 to C:\oracle\DevSuiteHome_1\forms
    It feels like I am going crazy, because this all worked before, and now I cannot get it to work.
    By the way, I am using Windows Vista and Forms 10.1.2.3.0

  • File Adapter Directory Path

    Hi,
    I have hot coded the directory path.
    I want to read the input directory path for fileadapter from a file(i will have a configuration file where i will set values for parameters).
    Regards
    Vishnu

    Thanks Ashish, it is helpful.
    Just one more question, I am not sure what value do I add from making physical to logical. Let's say if I have file polling read operation (not sync read), then if I configure physical path it will be hardcoded in jca wsdl file, if I configure logical it is hard coded in bpel.xml file.
    Unlike other preferences I am not able to update my logical directory in bpel.xml at run time in descripter tab. So if my input directory changes for some reason, I have to replace it (via ANT) and redeploy the process no matter what.
    Let me know if I understand it correctly.
    Vishnu,
    Please clarify which operation you are using, if you are using sync read or write, you can read your directory and file name from parameter file and pass it to adapter for reading that file. Adapter will give you content and also the name file/directory as header variable.
    If you are using polling operation, "after reading" the file adapter will provide file name and directory in header. But if you want pass the name of directory to adapter for reading the file, then I have asked similar question to Ashish.
    Regards,
    Chintan

  • PI sender communication channel not reading files from NFS directory

    Hello,
    I have a sender communication channel configured to read file from NFS directory which is on ECC server. A program in ECC generates the file and puts it on the ECC server in the output directory. PI sender communication channel is supposed to pickup this file and process it. If I give the NFS path as the source directory, I am getting error: Configured source directory '//Server/DIR/OUT' does not exist. I tried putting '
    Server\DIR\OUT' too but same error. Do I have to add the NFS path of ECC into PI as logical path?
    Any suggestions?
    Thanks,
    Sangita

    Hello Sangita,
    Your ECC server is an external system, therefore you need to activate FTP service in that system and use the transport protocol FTP:
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    You can use NFS protocol when you have a local directory in XI server.
    Best Regards,
    .Luis Bernal.

  • Issue with UTL FILE, does not read directory path

    Hi Guys
    I have created a procedure using a UTL_File, but when I execute that procedure, it comes with an invalid directory path.
    create directory r_bmw as 'C:\BMW';
    grant read, write on directory r_bmw to bmw;
    The above have been created successfully. (r_bmw is the Directory Name. C:\BMW is the directory path.)
    Below is my code:
    create or replace
    PROCEDURE DCA_BMW_OUT
    IS
    -- Declare all variables as reference
    v_out_file UTL_FILE.FILE_TYPE;
    v_row_Count NUMBER;
    r_bmw NUMBER;
    v_out_directory all_directories.directory_path%type;
    v_out_filehandle UTL_FILE.FILE_TYPE := NULL;
    v_out_buffer varchar2 (32767);
    v_records NUMBER;
    body_output varchar2(32759 BYTE);
    dictionary_guarantorsexist varchar2 (1 Char);
    -- Text required within this part of the procedure
    v_body varchar2(32767 BYTE);
    v_header VARCHAR2(32759 BYTE);
    BEGIN
    --- Directories have been created
    FOR r_bmw IN
    ( SELECT *
    FROM dcaadditionaldata
    WHERE directory_name IS NOT NULL
    ) LOOP
    -- inner loop produces the rows in each file
    -- outer loop identifies each of the dca's you want to generate a file for
    BEGIN
    -- Output file to be added into the directory specified
    v_out_file := utl_file.fopen (r_bmw.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
    -- The Header data which will be outputted to the file
    v_header := 'KennzeichenBrgschaftsforderungGesamtforderung|Währung|Übergabedatum|DifferenzierungAnwalts-oderInkassofall|MainMarktpartnernummer|
    MainAnrede|MainTitel|MainName|MainVorname|MainStraße|MainHausnummer|MainPLZ|MainOrt|MainLand|MainGeburtsdatum|MainTelefonnr.Schuldner|G1Marktpartnernummer
    |G1Anrede|G1Titel|G1Name|G1Vorname|G1Straße|G1Hausnummer|G1PLZ|G1Ort|G1Land|G1Geburtsdatum|G1Telefonnr.Schuldner|G2Marktpartnernummer|G2Anrede|G2Titel|
    G2Name|G2Vorname|G2Straße|G2Hausnummer|G2PLZ|G2Ort|G2Land|G2Geburtsdatum|G2Telefonnr.Schuldner|G3Marktpartnernummer|G3Anrede|G3Titel|G3Name|G3Vorname|
    G3Straße|G3Hausnummer|G3PLZ|G3Ort|G3Land|G3Geburtsdatum|G3Telefonnr.Schuldner|G4Marktpartnernummer|G4Anrede|G4Titel|G4Name|G4Vorname|G4Straße|G4Hausnummer|
    G4PLZ|G4Ort|G4Land|G4Geburtsdatum|G4Telefonnr Schuldner|G5Marktpartnernummer|G5Anrede|G5Titel|G5Name|G5Vorname|G5Straße|G5Hausnummer|G5PLZ|G5Ort|G5Land|
    G5Geburtsdatum|G5Telefonnr.Schuldner|Kundennr.|Bestandsnr.|Finanzierungsnr.|KennzeichenFinanzierung/Leasing|Kennzeichenprivat/gewerblich|
    reguläresVertragsende|Laufzeit|Vertragsdatum|Vertragsstatus|Ratenbetrag|Filiale/Gebiet|Finanzierungstyp|BankverbindungKonto|BankverbindungBLZ|
    RSVKennzeichen|Kündigungsdatum|Modell|Fahrgestellnummer|KFZKennzeichen|KFZZulassungsdatum|CoD1Marktpartnernummer|CoD1Anrede|CoD1Titel|CoD1Name|
    CoD1Vorname|CoD1Straße|CoD1Hausnummer|CoD1PLZ|CoD1Ort|CoD1Land|CoD1Geburtsdatum|CoD1Telefonnr.Schuldner|CoD2Marktpartnernummer|CoD2Anrede|CoD2Titel|
    CoD2Name|CoD2Vorname|CoD2Straße|CoD2Hausnummer|CoD2PLZ|CoD2Ort|CoD2Land|CoD2Geburtsdatum|CoD2Telefonnr.Schuldner|CoD3Marktpartnernummer|CoD3Anrede|
    CoD3Titel|CoD3Name|CoD3Vorname|CoD3Straße|CoD3Hausnummer|CoD3PLZ|CoD3Ort|CoD3Land|CoD3Geburtsdatum|CoD3Telefonnr.Schuldner|CoD4Marktpartnernummer|
    CoD4Anrede|CoD4Titel|CoD4Name|CoD4Vorname|CoD4Straße|CoD4Hausnummer|CoD4PLZ|CoD4Ort|CoD4Land|CoD4Geburtsdatum|CoD4Telefonnr.Schuldner|
    CoD5Marktpartnernummer|CoD5Anrede|CoD5Titel|CoD5Name|CoD5Vorname|CoD5Straße|CoD5Hausnummer|CoD5PLZ|CoD5Ort|CoD5Land|CoD5Geburtsdatum|
    CoD5Telefonnr.Schuldner Y|Y|5830,99|EUR|20/08/2009|DCA|4|123456|Herr||Mueller|Rainer|Messigasse|33|84432|Filz|Deutschland|01/07/1957|08912345|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||||||||||||||76543|5000234567||Lease|Privat|12/12/2013|60|12/12/2008||250,50|US|Rate|1234567890|32343450|N||BMW 320 i|W34567890PA34567|M-H-3456|09/12/2008||||||||||||||||||||||||
    N|450,80|EUR|20/08/2009|DCA|4|987654|Frau||Meier|Heide|Beinstr.|44|86353|Laus|Deutschland|03/06/1949|08987654|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||87654||8765675585|Loan|Gewerblich|14/03/2012|72|14/03/2006||500,01|DF|Select|976579657|32343450|N||BMW 500 sl|W94567890PA34568|M-H-3457|10/03/2006|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345
    Y|33970,50|EUR|20/08/2009|Lawyer|4|64646464|Frau||Schmidt|Susanne|Hueftgasse|55|89363|Maus|Deutschland|23/08/1933|08934567|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||98757|5000785675||Lease|Privat|11/11/2009|48|11/11/2005||380,70|GH|Zielrate|234567899|32343450|Y||BMW 380 s|W54567890PA34569|M-H-3458|07/11/2005||||||||||||||||||||||||
    N|10040,20|EUR|20/08/2009|Lawyer|4|4865465|Herr||Schulz|Karl|Nasenweg|77|83354|Schuh|Deutschland|18/01/1965|08972545|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||46789|50004765787||Lease|Privat|16/09/2012|60|16/09/2007||1234,56|OS|ZUS|98765432|32343450|Y||BMW 280 i|W74567890PA34570|M-H-3459|12/09/2007||||||||||||||||||||||||';
    utl_file.PUT_LINE(v_out_file,v_header,TRUE);
    -- Below will output a row of data which satisfy the requirements.
    FOR body_output IN
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.DCAID = 41
    AND Dcaaccountallocation.status = 3
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    LOOP
    UTL_FILE.PUT_LINE (v_out_file,
    body_output.CUSTOMERNUMBER|| '|' || body_output.ACCOUNTNUMBER|| '|' ||body_output.CDTITLE|| '||' ||body_output.CDFIRSTNAME || '|||||' ||
    body_output.CDLASTNAME|| '||||' || body_output.ACCOUNTTYPE|| '|' ||body_output.ORIGINALCONTRACTENDDATE|| '||||' ||body_output.CONTRACTTERM || '|||||' ||
    body_output.CONTRACTENDDATE|| '|' || body_output.BRANCHAREA|| '||' ||body_output.PRODUCTTYPE|| '||' ||
    body_output.HOUSEBANKACCOUNT|| '|||' || body_output.CARMODEL|| '||||' ||body_output.CARLICENCE|| '|' ||
    body_output.ARREARSBALANCE|| '||||' || body_output.CODEBTOR|| '|' ||body_output.GUARANTORnumber);
    END LOOP;
    -- UTL_FILE.fclose (v_out_file);
    -- EXCEPTION
    --WHEN OTHERS THEN
    --UTL_FILE.put_line (v_out_file, 'failed');
    -- If any errors occur when closing the file, then we close the opened file.
    IF utl_file.is_open(v_out_file) THEN
              UTL_FILE.put_line (v_out_file, 'failed');
    UTL_FILE.fclose (v_out_file);
    END IF;
    END;
    UPDATE DebtEpisodes
    SET handoverdate = null
    WHERE DCAORLAWYER = 'DCA'
    AND accountid IN
    ( SELECT accountid
    FROM Dcaaccountallocation
    WHERE Dcaaccountallocation.status = 3
    AND Dcaaccountallocation.dcaid = 41
    END LOOP;
    END DCA_BMW_OUT;
    -- It compiles successfully, but when executes, it provides me with the 'invalid directory path' error message.
    Any help?
    Thanks

    Ram wrote:
    DCAID DIRECTORY_NAME MPNO IN_DIRECTORY_NAME INVESTOR
    4     DCA_PKFO_OUT     51950     DCA_PKFO_IN     (null)
    41     INV_ALTOR_OUT     488742     INV_ALTOR_IN Y
    2     DCA_NIG_OUT     686007     DCA_NIG_IN     (null)
    3     DCA_RAF_OUT     777163     DCA_RAF_IN     (null)
    21     INV_INFOSCORE_OUT 3482400     INV_INFOSCORE_IN     Y
    22     INV_HOIST_OUT     2866813     INV_HOIST_IN     Y
    Above is the output when select * from dca additional data.
    I have edited the r_bmw to varchar (32757 BYTE);
    however, the same errors still appear. Would I need to change the select statement to a different table...and not dca additional data?
    ThanksSo you have created a directory name r_bmw
    create directory r_bmw as 'C:\BMW';
    grant read, write on directory r_bmw to bmw;And your are querying select * from dca additional data, which doesn't return your recently created directory.... So... what to do what to do.... You should query the all_directories with directory_name = 'r_bmw'.

  • Reading file structure and path from other local system share in jsp

    Hi,
    I have a requirement where I need to list all the file and folder structure from other shared folder from different path.
    \\tempx\\test , here test is the folder thats shared on tempx folder. if I copy and paste the path "\\tempx\\test" in start->run it opens the file in window. Same could be achived in java with File. However it gives issues in jsp. Please help me to resolve the issue.
    Thanks in advance.

    I am using below code to access share folder in other system and display all the file & directores below the folder. This code works fine in java in windows system, however if I move this in jsp and to Unix box issue appears. Plese guide
    import java.io.*;
    import java.io.File;
    import java.lang.*;
    public class BCMRepo
         public static void main(String args[])
              try
                   File fbcm = new File("\\\\tmp678\\test\\Common");     
                   String strFilename = fbcm.getAbsolutePath();
                   System.out.println("strFilename :"+strFilename);
                   String strFile[] = fbcm.list();
                   if(fbcm.isDirectory())
                             System.out.println("Is directory");
                             for (int i=0;i<strFile.length;i++)
                                  System.out.println(strFile);     
                   else
                             System.out.println("Is not directory");     
              catch(Exception e)
                   System.out.println("Error :"+e);

  • Reading files and directory from a directory

    ublic static void readFromDirectory(String dirName) {
              // stop word ArrayLists
              ArabicStop();
              EnglishStop();
              FrenchStop();
              SpanishStop();
              DutchStop();
              File dir = new File(dirName);
              if (dir.isDirectory()) {
                   String[] child = dir.list();
                   System.out.println("hi Iam here");
                   for (int i = 0; i < child.length; i++) {
                        readFromDirectory(child.toString());
              File[] files = dir.listFiles();
              if (files == null) {
                   System.out.println("There are no files in this Directory ");
              } else {
                   for (int j = 0; j < files.length; j++) {
                        String filename = files[j].toString();
                        readFile(filename);
                   if (dirName.equalsIgnoreCase("English")
                             || dirName.equalsIgnoreCase("Nonenglish")) {
                        for (int i = 0; i < a2.size(); i++) {
                             keyWord = a2.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
                   } else if (dirName.equalsIgnoreCase("Spanish")) {
                        for (int i = 0; i < a5.size(); i++) {
                             keyWord = a5.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
                        //System.out.println(m1);
                   } else if (dirName.equalsIgnoreCase("French")) {
                        for (int i = 0; i < a3.size(); i++) {
                             keyWord = a3.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
         public static void main(String[] args) {
              int countText = 0;
              int c;
              test t1 = new test();
              System.out.println("IN NON - ENGLISH DOCUMENTS - P :");
              t1.readFromDirectory("NonEnglish");
              for (int j = 0; j < text.size(); j++) {
                   if (!text.get(j).toString().equalsIgnoreCase("")) {
                        countText++;
              c = countText;
              //System.out.println(c);
              //System.out.println(text.size());
              for (int i = 0; i < a2.size(); i++) {
                   String word = a2.get(i).toString();
                   String m = (m1.get(word)).toString();
                   double x = Double.parseDouble(m);
                   System.out.println(word + ":" + (x / c) * 100 + " %");
    I wanna read text files from directory that contain - lots of other directorys... and by using this code I have error,,,
    Can anyone help me plzzz
    Edited by: Shamma on Oct 9, 2008 3:32 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You actually have more than 1 problem: you cannot traverse directories recursively and you get a NullPointerException.
    For the first problem you might want to verify what this statement returns:
    child.toString() (I honestly don't understand why you are calling toString() on a String object, but that's not the real problem!)
    You probably expect it to be a full absolute path.
    The NullPointerException has already been pointed out by masijade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to make SSIS packages automatically read the input file from a path?

    Currently I am using a SSIS package to read data from a .dat file and load it into SQL Server tables.
    I am placing the input .dat file on the desktop. In the connection manager -> Browse option, I am pointing this file to create connection.
    The file naming convention is like - aSNAP_Data_20140926_P-2014-09-26_07.02.36
    However, I need the SSIS package to automatically read the input file from a folder which is located in a remote server. This folder has lots of files where input files are added on a daily basis with the date value in the file name as mentioned above.
    I want to schedule the SSIS package to run daily and take the latest file in the folder based on the date.
    Please let me know how to do it. Any help would be highly appreciated.....
    Thanks in advance.

    Hi SQL_SSIS_Dev,
    According to your description, you want to get the latest file from a path to a SQL Server table. After testing the issue in my environment, we can refer to the following steps to achieve your requirement:
    Create two variables, VarFolderPath stores the folder path in which our files exist, VarFileName hold the value of most recent File Name.
    Drag a Script Task from SSIS Toolbox to Control Flow Pane, then select “User::VarFolderPath” as ReadOnlyVariables, select “User::VarFileName” as ReadWriteVariables.
    Then Edit Script with the C# code below:
    Add “using System.IO;” into namespace.
    Add the code below under Main function:
    var directory= new DirectoryInfo(Dts.Variables["User::VarFolderPath"].Value.ToString());
                FileInfo[] files = directory.GetFiles();
                DateTime lastModified = DateTime.MinValue;
                foreach (FileInfo file in files)
                    if (file.LastWriteTime > lastModified)
                        lastModified = file.LastWriteTime;
                        Dts.Variables["User::VarFileName"].Value = file.ToString();
    Drag a Data Flow Task to Control Flow Pane and connect to Script Task.
    In the Data Flow Task, drag a Flat File Source with a file in the source folder as all the files have same structure as the File name.
    Add the property below the Flat File Connection Manger expression:
    Property: ConnectionString      Expression: @[User::VarFolderPath] +"\\"+ @[User::VarFileName]
    Drag an OLE DB Destination that connect to the Flat File Source, then configure a table to store the data.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • Call recorder for iphone 5s

    i am having a iphone 5s which i am looking for a call recording app for voice calls..

  • Error when I run a flow

    friends can help me with this error please. ODI-1228: Task MAP_ST_PO_VENDORS (Integration) fails on the target ORACLE connection ODI_STAGE. Caused By: java.sql.SQLSyntaxErrorException: ORA-04045: errors during recompilation/revalidation of ODI_STAGE.

  • Payroll (Payment Methods)   Show oldest posts first  (Default) Show newest

    Hi everybody I am implementing HRMS R12. In the Payroll Setup, when I setup the payment methods it gives me an error telling that: no keyflex field have been constructed to the Bank Details and ask to consult the DBA. When I open the Payment Methods

  • Server 2008 SP2 Winsxs

    I still have a Windows Server 2008 SP2 online.  Plan to eventually migrate it to 2012, but that won't happen for a few months. At this time, the drive space on C: is down to 1.9GB.  It's all being consumed by the dreaded WinSxS folder.   I've found h

  • How can i turn off the computer remotely using java?

    is it possible to use a java code for turning off the computer remotely by other computer in LAN? or if it is not possible how can i achieved that goal? thanx