Specifying UNIX path in java properties file

Hi,

I wonder if an expert can assist.

I need to specify a unix path coreectly in my  properties file sitting on my C drive, as I need
to read a flat file from UNIX I know I can't just do;

 /home/johno/myfile.txt

and some escaping sequence is required.


Many thanks

nuz1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
> I know I can't just do;
> /home/johno/myfile.txt

That could be fine, how is the path used in your app?
0
nuz1Author Commented:
hmm,

Sorry its a unix path ie \home\johno\myfile.txt ! it did not work

that did not work , I was told to use something like \\home\\johno\\myfile.txt

What do ya say?

Thanks.
0
objectsCommented:
> Sorry its a unix path ie \home\johno\myfile.txt ! it did not work

try it as you stated originally in your question

how is it being used?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

nuz1Author Commented:
Sorry corrction

/home/johno/myfile.txt

is the unix path!

but my code don't like it

do I need  //home//johno//myfile.txt ?

0
nuz1Author Commented:
By the way it work fine if I use a foile on my C drive and specify

c//testarea//mytext.txt
0
objectsCommented:
how exactly does your code not like it?
0
nuz1Author Commented:
Just a minute getting error message..

0
nuz1Author Commented:
Caused by: java.io.FileNotFoundException: \test\dyn\data\gsbl\TESTT1main\app\data\instrument_20040917_v4.dat (The system cannot find the path specified)
0
nuz1Author Commented:
Hi Objects can idea?
0
nuz1Author Commented:
correction , sorry any idea?

0
objectsCommented:
That path uses \'s, not /.
I thought you said you were using /.
0
nuz1Author Commented:
Sorry for the confusion

As you know, UNIX paths are like :

/test/dyn/data/gsbl/TESTT1main/app/data/instrument_20040917_v4.dat

When I put that in I get:

Caused by: java.io.FileNotFoundException: \test\dyn\data\gsbl\TESTT1main\app\data\instrument_20040917_v4.dat (The system cannot find the path specified)

So please please clarify how this should be specified in properties (its an XML file .

)

OK if  I put this in properties I get
0
objectsCommented:
What are you running this on?  I don't see how the file separators are changing.
0
nuz1Author Commented:
I'm running the the java in IBM Websphere app server (out of container). As a java client (all on my PC).  Need to read the file from UNIX.

0
tomboshellCommented:
sounds like you are looking at the local system for a file that would be located on the server.  You will need to give the path to the server (the UNIX computer) for the program.  The best would be to give it in a URL format.   So, of course it is saying that the file is not found on the client (where you are currently looking), because you need to look in the server.  
0
nuz1Author Commented:
Hi could you please show how to specify it in URL format given the UNIX file is:

/test/dyn/data/gsbl/TESTT1main/app/data/instrument_20040917_v4.dat


thanks very much.
0
objectsCommented:
is the unix file system mounted?
How is the client expected to access the Unix server?
0
tomboshellCommented:
If my comment is heading in the right direction then the next question is how you are planning to connect through the network.  Standard-mapped drives, sockets, or http?  Since you mention that you are running an app server then I would use http or sockets, take a look at the following examples to see what you can/could use: http://www.javaalmanac.com/egs/java.net/pkg.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.