portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler JetspeedProfileManagerService.java
Date Fri, 20 Apr 2001 07:34:38 GMT
taylor      01/04/20 00:34:38

  Modified:    src/java/org/apache/jetspeed/services/profiler
                        JetspeedProfileManagerService.java
  Log:
  Was throwing null pointer exception since switching over to TurbineServlet service.
  The problem was that TurbineServlet.getResource used ServletContext.getResource, which returned
null
  when the resource didnt exist...
  Rewrote CreateUserProfile() to no longer use TurbineServletService,
  since the resource didn't exist yet. Instead we use TurbineServlet.getRealPath, which doesnt
care if the
  String parameter exists or not
  
  Revision  Changes    Path
  1.14      +13 -14    jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/JetspeedProfileManagerService.java
  
  Index: JetspeedProfileManagerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/JetspeedProfileManagerService.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JetspeedProfileManagerService.java	2001/04/17 20:36:39	1.13
  +++ JetspeedProfileManagerService.java	2001/04/20 07:34:34	1.14
  @@ -104,7 +104,7 @@
    *
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
    * @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>
  - * @version $Id: JetspeedProfileManagerService.java,v 1.13 2001/04/17 20:36:39 raphael
Exp $
  + * @version $Id: JetspeedProfileManagerService.java,v 1.14 2001/04/20 07:34:34 taylor Exp
$
    */
   
   public class JetspeedProfileManagerService  extends TurbineBaseService
  @@ -289,17 +289,15 @@
           CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( rundata );
           // FIXME: this needs to be handled better for users/groups/roles
           rundata.getParameters().add(TEMP_USER, userName);
  -        Profile profile = getResourceURL(rundata, cm, false);
  -        String url = profile.getURL();
  -        String realPath = null;
  -        try
  -        {
  -            realPath = new URL(url).getFile();
  -        }
  -        catch (MalformedURLException e)
  -        {
  -            realPath = url;
  -        }
  +        //Profile profile = getResourceURL(rundata, cm, false);
  +        // get the media type from the capability map or rundata
  +        String mediaType = getMediaType(rundata, cm);
  +        BaseProfile profile = new BaseProfile();
  +        // get the target profile: by group/role/user
  +        String path = getPath(rundata, mediaType, profile);
  +        String resource = getResource(rundata, profile);
  +        String finalPath = root + path + resource;
  +        String realPath = TurbineServlet.getRealPath(finalPath);
           File file = new File(realPath);
           if (!file.exists())
           {
  @@ -317,10 +315,11 @@
               }
               // make the directories and then copy it
               String parent = file.getParent();
  -            File path = new File(parent);
  -            path.mkdirs();
  +            File filePath = new File(parent);
  +            filePath.mkdirs();
               FileCopy.copy( fallbackReal, realPath );
           }
  +        profile.setURL(finalPath);
           this.setSessionProfile(rundata, profile);
           return profile;
       }
  
  
  

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


Mime
View raw message