You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2001/04/20 09:34:38 UTC

cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler JetspeedProfileManagerService.java

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