Re: R: how to read files in file system
On 18 Sep 2012, at 07:22, Ge Gestione Elaboratori(IBM Business Partner) case...@gmail.com wrote: Excuse me Dan: attached the screenshot. Zeesh. Stop attaching it, paste some info inline in the message and stop being lazy. p paolo -Messaggio originale- Da: Daniel Mikusa [mailto:dmik...@vmware.com] 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: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
R: how to read files in file system
Excuse me Dan: attached the screenshot. paolo -Messaggio originale- Da: Daniel Mikusa [mailto:dmik...@vmware.com] 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: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: R: how to read files in file system
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\) case...@gmail.com wrote: Excuse me Dan: attached the screenshot. paolo -Messaggio originale- Da: Daniel Mikusa [mailto:dmik...@vmware.com] 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: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org