vgritsenko    2003/01/23 20:27:40

  Modified:    src/java/org/apache/cocoon Main.java
  Log:
  Code cleanup: fix javadoc errors, remove unused variables.
  
  Revision  Changes    Path
  1.29      +20 -31    xml-cocoon2/src/java/org/apache/cocoon/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Main.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Main.java 7 Jan 2003 23:17:08 -0000       1.28
  +++ Main.java 24 Jan 2003 04:27:40 -0000      1.29
  @@ -787,8 +787,8 @@
                   }                
               }
               
  -            //I have to add also broken links to the absolute links
  -            //to be able to generate the "broken link" page
  +            // I have to add also broken links to the absolute links
  +            // to be able to generate the "broken link" page
               absoluteLinks.add(absoluteLink);  
               final String translatedRelativeLink = NetUtils.relativize(path, 
translatedAbsoluteLink);
               translatedLinks.put(link, translatedRelativeLink);
  @@ -800,24 +800,20 @@
               // Process URI
               File file = IOUtils.createFile(destDir, NetUtils.decodePath(filename));
               OutputStream output = new BufferedOutputStream(new 
FileOutputStream(file));
  -            
  -             try{
  -                String type = getPage(deparameterizedURI, parameters, 
translatedLinks, output);
  -                printlnInfo(uri); //(can also output type)
  -            }
  -             catch(ProcessingException pe){
  -                 printBroken(filename, 
DefaultNotifyingBuilder.getRootCause(pe).getMessage());
  -                 resourceUnavailable(file, uri);
  -             }
  -             finally{
  -                try{ 
  -                   output.close();
  -                }
  -                catch(IOException ioex){
  +
  +            try{
  +                getPage(deparameterizedURI, parameters, translatedLinks, output);
  +                printlnInfo(uri); // (can also output type returned by getPage)
  +            } catch(ProcessingException pe) {
  +                printBroken(filename, 
DefaultNotifyingBuilder.getRootCause(pe).getMessage());
  +                resourceUnavailable(file, uri);
  +            } finally {
  +                try {
  +                    output.close();
  +                } catch(IOException ioex) {
                       log.warn(ioex.toString());
                   }
  -             }
  -
  +            }
           } catch (Exception rnfe) {
               System.out.println("XXX"+rnfe);
               log.warn("Could not process URI: " + deparameterizedURI);
  @@ -825,7 +821,6 @@
           }
   
           return absoluteLinks;
  -      
       }
   
       /**
  @@ -846,7 +841,6 @@
           parameters.put("accept", accept);
           String deparameterizedURI = NetUtils.deparameterize(uri, parameters);
   
  -        String path = NetUtils.getPath(uri);
           String filename = mangle(uri);
           String type = getType(deparameterizedURI, parameters);
           String ext = NetUtils.getExtension(filename);
  @@ -980,7 +974,7 @@
        * Try to process something but don't throw a ProcessingException.
        *
        * @param env the <code>Environment</code> to process
  -     * @returns boolean true if no error were cast, false otherwise
  +     * @return boolean true if no error were cast, false otherwise
        * @exception Exception if an error occurs, except RNFE
        */
       private boolean processLenient(Environment env) throws Exception {
  @@ -997,9 +991,8 @@
       /**
        * Print the message of a broken link.
        *
  -     * @param env the <code>Environment</code> to process
  -     * @returns boolean true if no error were cast, false otherwise
  -     * @exception Exception if an error occurs, except RNFE
  +     * @param url the <code>URL</code> of the broken link
  +     * @param cause of the broken link
        */
       private void printBroken(String url, String cause) {
   
  @@ -1037,9 +1030,7 @@
       /**
        * Print an info message.
        *
  -     * @param env the <code>Environment</code> to process
  -     * @returns boolean true if no error were cast, false otherwise
  -     * @exception Exception if an error occurs, except RNFE
  +     * @param message the message to print
        */
       private void printlnInfo (String message) {
           log.info(message);
  @@ -1049,9 +1040,7 @@
       /**
        * Print an info message.
        *
  -     * @param env the <code>Environment</code> to process
  -     * @returns boolean true if no error were cast, false otherwise
  -     * @exception Exception if an error occurs, except RNFE
  +     * @param message the message to print
        */
       private void printInfo (String message) {
           log.info(message);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to