Try:
URI uri = new URI("file//c:/.."); // win
Or
"file:///yourdir/.." on unix (note 3 "/").
From uri you can get the url and from here you can open an inputstream or you
can use "new File(url.toFile())"
To access a resource from your classpath the following will do:
URL url =
Thread.currentThread().getContextClassloader().getResource("relativeNameOfFile");
Basically this should work, but its untested as my phone does not provide a
java compiler :-)
Jens
Sent from my iPhone
On 18.09.2012, at 08:21, "Ge Gestione Elaboratori\(IBM Business Partner\)"
<[email protected]> wrote:
> Excuse me Dan:
> attached the screenshot.
> paolo
>
> -----Messaggio originale-----
> Da: Daniel Mikusa [mailto:[email protected]]
> Inviato: martedì 11 settembre 2012 13.51
> A: Tomcat Users List
> Oggetto: Re: how to read files in file system
>
> On Sep 11, 2012, at 3:11 AM, IBM partner Gestione Elaboratori wrote:
>
>> With jsp i can read files in the file system only if there are located
> under
>> the directory webapps/<application>/<file>.
>>
>> If I read a file ,for example, in c:/<filename> Tomcats signals an error
> (se
>> atthachment)
>
> Again, there is no attachment. The list is probably removing it. Please
> try pasting the content into your email.
>
> Please also include the error that is given. Without that, we can only
> guess at what is happening.
>
> Dan
>
>> How to read files located everywere in the file system?
>>
>>
>>
>> paoloc
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]