My interpretation of the restriction on file io, is that this code is fine. It uses a 
classloader. The container implementor is in charge of class loaders, but not of the 
java.io.File class.

But which of the priests has the best interpretation of the holy spec?

/Johan

Den 8 Jan 2001 skrev Olivier Duhart:

> I want to load the content of a file from my ejb jar file. I try this
> piece of code :
>
> private void test() {
>     System.out.println("test()");
>     try {
>         java.io.InputStream oStream =
> this.getClass().getResourceAsStream("dummy.txt");
>         int oRead = 0;
>         byte[] oBuffer = new byte[1024];
>         String oContent = "";
>         while (oRead != -1) {
>             oRead = oStream.read(oBuffer);
>             if (oRead > 0) {
>                 oContent += new String(oBuffer,0,oRead);
>             }
>         }
>         oStream.close();
>         System.out.println("content = " + oContent);
>     }
>     catch(Exception e) {
>         e.printStackTrace();
>     }
> }
>
> It works well (with JBoss) but my question is : Am I allowed to do this
> ?
>
> Thanks
>
> Olivier
>
> --
> Olivier Duhart
> Wokup! - Product Team
> [EMAIL PROTECTED]
> +33 299 844 412
>
>
>
>
> --
> Olivier Duhart
> Wokup! - Product Team
> [EMAIL PROTECTED]
> +33 299 844 412
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to