commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <dakota.j...@gmail.com>
Subject Re: File upload and download.
Date Wed, 17 Nov 2004 17:06:42 GMT
Hi, David,

Send my your exceptions.  However, what you must be doing wrong is to
not put your values in for the "webapp" and the "whatever".  In the
following code you must have your classpath for the class Classpath in
the package statement: "com.whatever.classpath" and where it says
"webapp" you need to put in the name of the folder which you have
sitting in CATALINA_HOME.  I you were to substitute "com" for "webapp"
in public static final String CATALINA_HOME = HERE.substring(
                                                                          1,

   HERE.lastIndexOf("webapp")); then you would get the result 
      "[CATALINA_HOME]/webapp/WEB-INF/classes"

Do that and you will see what the value of webapp is for you.  Do you
understand?

Jack

package com.whatever.classpath;

 import java.io.File;
 import java.net.URL;

 public final class Classpath {
   public static final String HERE  =
Classpath.class.getClassLoader().getResource(
                                                            "com" +
File.separator +

"whatever" + File.separator +

"classpath" + File.separator +

"Classpath.class").getFile();
   public static final String CATALINA_HOME = HERE.substring(
                                                                          1,

   HERE.lastIndexOf("webapp"));
 }


On Wed, 17 Nov 2004 16:09:44 -0000, Pawson, David
<david.pawson@rnib.org.uk> wrote:
> 
> 
>     -----Original Message-----
>     From: Dakota Jack
> 
>     The following code gets you CATALINA_HOME.  I cannot tell
>     if this will be helpful to you or not.  Probably not, but
>     what the heck, David.
> 
> 
> Thanks for the reply Jack.
> Sorry, but I can't get other than an exception out of it.
> Bottom line the java is more advanced than I.
> 
> I'll try and trace through what's happening;
> but I'm getting lost at the elements of the getResource call.
> I'm unsure of what resource I'm looking for, and the api javadocs
> are not very helpful to me.
> 
> I'll come back when I have a little more Jack.
> 
> regards DaveP
> 
> --
> 
> 
> DISCLAIMER:
> 
> NOTICE: The information contained in this email and any attachments is
> confidential and may be privileged.  If you are not the intended
> recipient you should not use, disclose, distribute or copy any of the
> content of it or of any attachment; you are requested to notify the
> sender immediately of your receipt of the email and then to delete it
> and any attachments from your system.
> 
> RNIB endeavours to ensure that emails and any attachments generated by
> its staff are free from viruses or other contaminants.  However, it
> cannot accept any responsibility for any  such which are transmitted.
> We therefore recommend you scan all attachments.
> 
> Please note that the statements and views expressed in this email and
> any attachments are those of the author and do not necessarily represent
> those of RNIB.
> 
> RNIB Registered Charity Number: 226227
> 
> Website: http://www.rnib.org.uk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message