vladimir    2002/11/18 21:13:47

  Modified:    java/src/org/apache/xindice/util MD5.java
               java/src/org/apache/xindice/tools XMLTools.java
  Log:
  Stacktrace sent to the System.err (like in JDK1.4)
  
  Revision  Changes    Path
  1.4       +3 -3      xml-xindice/java/src/org/apache/xindice/util/MD5.java
  
  Index: MD5.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/util/MD5.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MD5.java  31 Oct 2002 07:01:45 -0000      1.3
  +++ MD5.java  19 Nov 2002 05:13:47 -0000      1.4
  @@ -80,10 +80,10 @@
         }
         catch(NoSuchAlgorithmException e) {
            System.out.println("MD5 not supported.");
  -         e.printStackTrace(System.out);
  +         e.printStackTrace(System.err);
         }
         catch (Exception e) {
  -         e.printStackTrace(System.out);
  +         e.printStackTrace(System.err);
         }
   
         return digestString;
  
  
  
  1.15      +14 -9     
xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java
  
  Index: XMLTools.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XMLTools.java     17 Nov 2002 08:55:57 -0000      1.14
  +++ XMLTools.java     19 Nov 2002 05:13:47 -0000      1.15
  @@ -71,6 +71,7 @@
   import org.w3c.dom.*;
   import org.xmldb.api.DatabaseManager;
   import org.xmldb.api.base.Database;
  +import org.xmldb.api.base.XMLDBException;
   
   import java.io.File;
   import java.io.FileInputStream;
  @@ -121,7 +122,7 @@
          catch (Exception e) {
              System.out.println(e.getMessage());
              if (verbose == true) {
  -               e.printStackTrace(System.out);
  +               e.printStackTrace(System.err);
              }
          }
      }
  @@ -218,10 +219,10 @@
         } catch (NoSuchElementException e) {
            throw new NoSuchElementException("ERROR : " + e + " Switch found. 
Parameter missing.");
         } catch (NullPointerException e) {
  -         e.printStackTrace(System.out);
  +         e.printStackTrace(System.err);
            throw new NullPointerException("ERROR : " + e);
         } catch (Exception e) {
  -         e.printStackTrace(System.out);
  +         e.printStackTrace(System.err);
            throw new XindiceException("ERROR : " + e.getMessage(), e);
         }
      }
  @@ -275,9 +276,6 @@
               table.put( LOCAL, "true");
            } else if ( token.equalsIgnoreCase("-d") || 
token.equalsIgnoreCase("--dbconfig") ) {
               String configFile = System.getProperty("user.dir") + 
File.separator + at.nextSwitchToken();
  -            if (log.isDebugEnabled()) {
  -               log.debug(configFile);
  -            }
               System.setProperty(Xindice.PROP_XINDICE_CONFIGURATION, 
configFile);
               table.put( DB_CONFIG, configFile);
            } else if ( token.equalsIgnoreCase("-s") || 
token.equalsIgnoreCase("--namespaces") ) {
  @@ -334,11 +332,17 @@
                Command command = (Command)Class.forName( commandClass 
).newInstance();
                command.execute( table );
                return true;
  +          } catch (XMLDBException e) {
  +             System.err.println( "XMLDB Exception with code " + e.errorCode 
);
  +             if (table.get(VERBOSE).equals("true")) {
  +                e.printStackTrace(System.err);
  +             }
  +             return false;
             } catch (Exception e) {
  -            System.out.println("ERROR : " + e.getMessage() );
  +            System.err.println("ERROR : " + e.getMessage() );
      
               if (table.get(VERBOSE).equals("true")) {
  -               e.printStackTrace(System.out);
  +               e.printStackTrace(System.err);
               }
               return false;   
            }
  @@ -646,6 +650,7 @@
         System.out.println("    -d           " + "Path to the database 
configuration to use for the local ");
         System.out.println("                 database. Only applies if -l is 
specified.");
         System.out.println("    -t           " + "Specify the data type in 
collection index");
  +      System.out.println("    -v           " + "Verbose");
         System.out.println("    --pagesize   " + "Page size for file pages 
(default: 4096)");
         System.out.println("    --maxkeysize " + "The maximum size for file 
keys (default: 0=none)");
         System.out.println();
  
  
  

Reply via email to