Results 1 to 2 of 2
  1. #1
    snallami is offline Member
    Join Date
    May 2012
    Rep Power

    Default Issue with reading file path

    I am getting file path in eclipse plugin using org.eclipse.swt.widgets.FileDialog and saving the path in XML files.

    In web.xml , path is stored as below (I can't change backsladh to forwardslash or escape backslash since the value is coming from SWT FileDialog)


    In my filter , i have below code in init() method but am not able to get File reference due to special characters

    String filePath = filterConfig.getInitParameter("filePath");
    // Tried filePath = filePath.replace('\\','/') --> Didnot work since \n is a single character
    File f = new File(path)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Issue with reading file path

    If you know there should not be any valid lineend characters in the String, then replace \n with /
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 7
    Last Post: 03-05-2012, 05:26 PM
  2. Issue reading 375M text file with java
    By Nish_biz in forum Advanced Java
    Replies: 11
    Last Post: 12-12-2011, 12:33 PM
  3. Reading and writing the file in a specified path
    By harsha.udupa2008 in forum New To Java
    Replies: 4
    Last Post: 04-23-2010, 11:48 AM
  4. reading file from a path
    By new_coder in forum New To Java
    Replies: 5
    Last Post: 08-17-2009, 04:52 AM
  5. Weird path problem when reading properties file
    By jerry_popperq in forum New To Java
    Replies: 0
    Last Post: 03-18-2009, 03:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts