cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp XSPUtil.java
Date Wed, 11 Jun 2003 23:15:56 GMT
joerg       2003/06/11 16:15:56

  Modified:    src/java/org/apache/cocoon/components/language/markup/xsp
                        XSPUtil.java
  Log:
  code formatting
  
  Revision  Changes    Path
  1.6       +20 -25    cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPUtil.java
  
  Index: XSPUtil.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XSPUtil.java	31 May 2003 00:06:29 -0000	1.5
  +++ XSPUtil.java	11 Jun 2003 23:15:56 -0000	1.6
  @@ -89,7 +89,7 @@
    * @version CVS $Id$
    */
   public class XSPUtil {
  -    
  +
       public static String pathComponent(String filename) {
           int i = filename.lastIndexOf(File.separator);
           return (i >= 0) ? filename.substring(0, i) : filename;
  @@ -192,12 +192,12 @@
       }
   
       public static String formEncode(String text) throws Exception {
  -    	return URLEncoder.encode (text);
  +        return URLEncoder.encode(text);
       }
   
       // Shameless, ain't it?
       public static String formDecode(String s) throws Exception {
  -    	return URLDecoder.decode (s);
  +        return URLDecoder.decode(s);
       }
   
       /* Logicsheet Utility Methods */
  @@ -208,8 +208,7 @@
               pattern = "yyyy/MM/dd hh:mm:ss aa";
           }
           try {
  -            return (
  -                new SimpleDateFormat(pattern)).format(date);
  +            return (new SimpleDateFormat(pattern)).format(date);
           } catch (Exception e) {
               return date.toString();
           }
  @@ -223,14 +222,13 @@
       }
   
       public static int getSessionCount(Session session) {
  -        synchronized(session) {
  +        synchronized (session) {
               Integer integer = (Integer)session.getAttribute("util.counter");
               if (integer == null) {
                   integer = new Integer(0);
               }
               int cnt = integer.intValue() + 1;
  -            session.setAttribute("util.counter",
  -                new Integer(cnt));
  +            session.setAttribute("util.counter", new Integer(cnt));
               return cnt;
           }
       }
  @@ -295,8 +293,7 @@
       }
   
       public static void includeSource(String uri, String base, SourceResolver resolver,
ContentHandler contentHandler)
  -        throws RuntimeException {
  -        
  +            throws RuntimeException {
           if (base != null && base.length() == 0) {
               base = null;
           }
  @@ -313,36 +310,34 @@
           }
       }
   
  -    public static void includeString(String string, ComponentManager manager, ContentHandler
contentHandler) 
  -        throws RuntimeException {
  -
  -        XSPUtil.includeInputSource(new InputSource( new StringReader( String.valueOf(string))),
manager, contentHandler);
  +    public static void includeString(String string, ComponentManager manager, ContentHandler
contentHandler)
  +            throws RuntimeException {
  +        XSPUtil.includeInputSource(new InputSource(new StringReader(String.valueOf(string))),
manager,
  +                                   contentHandler);
       }
  -        
  -    public static void includeFile(String name, ComponentManager manager, ContentHandler
contentHandler, Map objectModel) 
  -        throws RuntimeException {
   
  +    public static void includeFile(String name, ComponentManager manager, ContentHandler
contentHandler, Map objectModel)
  +            throws RuntimeException {
           try {
  -            XSPUtil.includeInputSource(new InputSource(new FileReader(XSPUtil.relativeFilename(name,objectModel))),

  +            XSPUtil.includeInputSource(new InputSource(new FileReader(XSPUtil.relativeFilename(name,
objectModel))),
                                          manager, contentHandler);
           } catch (IOException e) {
               throw new CascadingRuntimeException("Could not include file " + name, e);
           }
  -    }   
  +    }
   
  -    public static void includeInputSource(InputSource source, ComponentManager manager,
ContentHandler contentHandler) 
  -        throws RuntimeException {
  -        
  +    public static void includeInputSource(InputSource source, ComponentManager manager,
ContentHandler contentHandler)
  +            throws RuntimeException {
           SAXParser parser = null;
           try {
  -            parser = (SAXParser) manager.lookup(SAXParser.ROLE);
  +            parser = (SAXParser)manager.lookup(SAXParser.ROLE);
               IncludeXMLConsumer consumer = new IncludeXMLConsumer(contentHandler);
               parser.parse(source, consumer, consumer);
           } catch (Exception e) {
               throw new CascadingRuntimeException("Could not include page", e);
           } finally {
               if (parser != null) {
  -                manager.release((Component) parser);
  +                manager.release((Component)parser);
               }
           }
       }
  
  
  

Mime
View raw message