Yes, this seems very odd to me.  Still, why did this fail for you?  I was 
under the impression that URLConnection.getPermission() would return an 
AllPermission and not a FilePermission, which would have caused this hack not 
to be used.  If the _url field has been initialized to URLConnection.getURL() 
then this should have worked fine with the original.

Anyways, saw your note that it all works now.  Sorry if this caused you much 
trouble.

--jason


Quoting Jules Gosnell <[EMAIL PROTECTED]>:

> That would be a question for Greg - who left to go skiing this morning -
> tough life! :
> 
> 
> 
>     /* ------------------------------------------------------------ */
>     /**
>      * Returns an File representing the given resource or NULL if this
>      * is not possible.
>      */
>     public File getFile()
>         throws IOException
>     {
>         // Try the permission hack
>         if (checkConnection())
>         {
>             Permission perm = _connection.getPermission();
>             if (perm instanceof java.io.FilePermission)
>                 return new File(perm.getName());
>         }
> 
>         // Try the URL file arg
>         try {return new File(_url.getFile());}
>         catch(Exception e) {Code.ignore(e);}
> 
>         // Don't know the file
>         return null;
>     }
> 
> 
> 
> Jules
> 
> 
> 
> Jason Dillon wrote:
> 
> > Just wondering, but why not use URLConnection.getURL().getFile() instead of
> URLConnection.getPermssion() ?
> >
> > --jason
> > _________________________________________________________
> > View thread online:
> http://main.jboss.org/thread.jsp?forum=66&thread=12217
> >
> > _______________________________________________
> > Jboss-development mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-development
> 




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to