Results 1 to 8 of 8
  1. #1
    sanjayksaini is offline Member
    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Smile Platform dependent File Path....

    Hi All
    i m stuck with this problem:
    In my application there is one path for the folder where resultlog is to be stored.it's like--C:\Application\SchedulerApi\Api\results\

    Now when the user installs the application,its not neccessary that he has
    c:\ as base directory.so what can i do to make this work with any base directory,say d:\ or e:\ or whatever...

    any help please..................
    thanks in advance..

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

    Default

    Without selecting the base directory, how can you define the path? there should be a logic in your application to select the base directory.

  3. #3
    sanjayksaini is offline Member
    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Smile plz help!!!!

    thanks for the reply Eranga,but my problem is that its an automation Framework of java and i have specified the location myself where 'ResultLog' has to be stored:
    If the client installs this application in C:\ the path of result file should be :
    C:\Application\SchedulerApi\Api\results\

    If the client installs this application in D:\ the path of the result file should be :
    C:\Application\SchedulerApi\Api\results\

    Now if i could know in which drive the client has installed the application,then it would solve my problem...
    plz help!!!!

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

    Default

    So why are you stuck on that. What ever the path client define, use the hard-coded path you want on the C:\ drive. I didn't see any difficulties there.

  5. #5
    DevzAbhi's Avatar
    DevzAbhi is offline Member
    Join Date
    Jul 2008
    Posts
    67
    Rep Power
    0

    Default

    Ask the client to set an env. variable

    YOUR_APPLICATION_HOME
    to xxx:\Application\

    you can access this variable at run time

    and append the rest of the path.
    DevZ;)

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    10

    Default

    File.listRoots() then have customer select drive letter, then do StringBuffer.append("\\Application\\SchedulerApi\\ Api\\results\\");
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #7
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    9

    Default Mistake?

    Eranga, I think the OP made a mistake and meant the following:
    If the client installs this application in D:\ the path of the result file should be :
    D:\Application\SchedulerApi\Api\results\
    sanjayksaini, please correct me if I'm mistaken.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

Similar Threads

  1. how can i give a file path to java stream ?
    By sheckoo in forum New To Java
    Replies: 2
    Last Post: 11-05-2008, 09:42 AM
  2. file path
    By Arsench in forum New To Java
    Replies: 7
    Last Post: 10-30-2008, 06:39 AM
  3. Load class file which resides in local path c:\
    By praveen.kb in forum Advanced Java
    Replies: 2
    Last Post: 08-12-2008, 01:55 PM
  4. Regular expression for file path
    By ravian in forum New To Java
    Replies: 3
    Last Post: 01-25-2008, 09:24 PM
  5. ERROR: Can't find dependent libraries
    By baltimore in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 06:37 AM

Posting Permissions

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