MIDRANGE dot COM Mailing List Archive



Home » JAVA400-L » May 2006

Re: Format of file format in the IFS directory in JAVA



fixed

    Hi George,

    Neither of your examples in the message below match what I posted.  The
1 or 3 slashes are *only* for the "file:" protocol.  Any slashes or
backslashes in the file path are separate and additional.

>From your last ones:

        > file:/TecnoXML/aces.xml

is completely invalid.


        > file:///TecnoXML/aces.xml

doesn't work ( file: + 2 slashes ), although some docs make it appear that
it should.


My examples, where myFilePath is "/TecnoXML/ACES.xml" were:

   "file:///" + myFilePath;

    "file:/" + myFilePath;

    Result:

    "file:////TecnoXML/ACES.xml"


    "file://TecnoXML/ACES.xml"

    Let me know if those don't work; maybe I'll have some time tomorrow to
check it out if that's the case, but IIRC, should do.


                                                         Joe Sam

Joe Sam Shirah -        http://www.conceptgo.com
conceptGO       -        Consulting/Development/Outsourcing
Java Filter Forum:       http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International?    http://www.jguru.com/faq/I18N
Que Java400?            http://www.jguru.com/faq/Java400


----- Original Message ----- 
From: "George Lopez" <georgerl@xxxxxxxxxxxx>
To: "Java Programming on and around the iSeries / AS400"
<java400-l@xxxxxxxxxxxx>
Sent: Wednesday, May 10, 2006 5:27 PM
Subject: Re: Format of file format in the IFS directory in JAVA


> Yes my JAVA program is not locating files in the AS400 IFS directory. I
> am running this program in the AS400 which also means I moved the jar
> and classes from my PC to the IFS directory too. The 1 to 3 slashes
> still does not work (Look below). The syntax I am using in Windows is
> C:\\Developement\\xml\\aces.xml. I also made sure this time I used the
> same case for the directory and file.
>
> Thanks
>
>
> file:/TecnoXML/aces.xml
> java.io.FileNotFoundException: No such path or directory.
> file:/TecnoXML/aces.xml
>
> file:///TecnoXML/aces.xml
> java.io.FileNotFoundException: No such path or directory.
> file:/TecnoXML/aces.xml
>
>
> Joe Sam Shirah wrote:
>
> >    Hi George,
> >
> >    So I take it your question is how to locate files?
> >
> >    To the best of my recollection, and I don't have time to double check
> >now, technically the "file:" protocol requires three ( 3 ) slashes.  It
> >also, for reasons I forget, will ( usta ) work with one ( 1 ) slash.  It
> >will not work with two slashes.
> >
> >    Examples for /TecnoXML/ACES.xml:
> >
> >    "file:///" + myFilePath;
> >
> >    "file:/" + myFilePath;
> >
> >    Result:
> >
> >    "file:////TecnoXML/ACES.xml"
> >
> >
> >    "file://TecnoXML/ACES.xml"
> >
> >    Incidentally, Java parsing for file structure will work with forward
> >slashes even for Windows, so you can avoid intermixing slashes and
> >backslashes.
> >
> >    Still, it should work the same on all platforms.  What syntax are you
> >using on Windows?
> >
> >
> >                                                         Joe Sam
> >
> >Joe Sam Shirah -        http://www.conceptgo.com
> >conceptGO       -        Consulting/Development/Outsourcing
> >Java Filter Forum:       http://www.ibm.com/developerworks/java/
> >Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
> >Going International?    http://www.jguru.com/faq/I18N
> >Que Java400?            http://www.jguru.com/faq/Java400
> >
> >
> >----- Original Message ----- 
> >From: "George Lopez" <georgerl@xxxxxxxxxxxx>
> >To: <java400-l@xxxxxxxxxxxx>
> >Sent: Wednesday, May 10, 2006 2:20 PM
> >Subject: Format of file format in the IFS directory in JAVA
> >
> >
> >
> >
> >>I have an java xml parser developed in Eclipse. When I run the parser in
> >>Websphere Development Studio and use the xml in my C: drive it works.
> >>But if I put the xml in the ifs directory in the AS400 I get error
> >>message below.....
> >>
> >>The IFS directory in the as400 is...
> >>/TecnoXML/ACES.xml
> >>
> >>
> >>Error if i use:  /TecnoXML/ACES.xml
> >>java.net.MalformedURLException: unknown protocol:
> >>
> >>Error if i use:  file:///TecnoXML/ACES.xml
> >>java.io.FileNotFoundException: No such path or directory.
> >>file:/TecnoXML/Aces.xml
> >>
> >>Error if i use:  file:\\\TecnoXML/ACES.xml
> >>java.io.FileNotFoundException: No such path or directory.
> >>file:\\\TecnoXML/ACES.xml
> >>
> >>-- 
> >>This is the Java Programming on and around the iSeries / AS400
(JAVA400-L)
> >>
> >>
> >mailing list
> >
> >
> >>To post a message email: JAVA400-L@xxxxxxxxxxxx
> >>To subscribe, unsubscribe, or change list options,
> >>visit: http://lists.midrange.com/mailman/listinfo/java400-l
> >>or email: JAVA400-L-request@xxxxxxxxxxxx
> >>Before posting, please take a moment to review the archives
> >>at http://archive.midrange.com/java400-l.
> >>
> >>
> >>
> >
> >
> >
> -- 
> This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
> To post a message email: JAVA400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.
>






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact