logo       

cvs commit: xml-xindice status.xml: msg#00015

Subject: cvs commit: xml-xindice status.xml
vgritsenko    2004/10/29 11:52:23

  Modified:    java/src/org/apache/xindice/tools/command
                        AddMultipleDocuments.java
               .        status.xml
  Log:
  clean up AddMultiple command, fix memory leak.
  
  Revision  Changes    Path
  1.13      +19 -24    
xml-xindice/java/src/org/apache/xindice/tools/command/AddMultipleDocuments.java
  
  Index: AddMultipleDocuments.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/command/AddMultipleDocuments.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AddMultipleDocuments.java 20 Jul 2004 20:31:37 -0000      1.12
  +++ AddMultipleDocuments.java 29 Oct 2004 18:52:23 -0000      1.13
  @@ -87,38 +87,33 @@
                       children = dir.list();
                   }
   
  -                System.out.println("Reading files from: " + dir.getName());
  +                System.out.println("Reading files from: " + 
dir.getCanonicalPath());
  +
  +                // Use the functionality already provided in AddDocument 
command to add this document
  +                final Command cmd = new AddDocument();
  +
  +                // Command parameters
  +                Hashtable localtable = new Hashtable();
  +                localtable.put(XMLTools.COLLECTION, 
table.get(XMLTools.COLLECTION));
  +                if (local != null) {
  +                    localtable.put(XMLTools.LOCAL, local);
  +                }
   
                   // Loop over documents, adding to db
                   for (int i = 0; i < children.length; i++) {
   
  -                    File files = new File(dir, children[i]);
  -                    if (files.isFile()) {
  -                        FileInputStream insr = new FileInputStream(files);
  -                        byte[] fileBuffer = new byte[(int) files.length()];
  -                        insr.read(fileBuffer);
  -
  +                    File file = new File(dir, children[i]);
  +                    if (file.isFile()) {
                           try {
  -
  -                            // Use the functionality already provided in 
Command.AddDocument to add this document
  -                            Command cmd = (Command) 
Class.forName("org.apache.xindice.tools.command.AddDocument").newInstance();
  -                            Hashtable localtable = new Hashtable();
  -                            String filepath = dir.getPath() + "/" + 
files.getName();
  -
                               // Populate hashtable to pass to AddDocument 
class
  -                            localtable.put(XMLTools.COLLECTION, 
table.get(XMLTools.COLLECTION));
  -                            localtable.put(XMLTools.NAME_OF, 
files.getName());
  -                            localtable.put(XMLTools.FILE_PATH, filepath);
  -                            if (local != null) {
  -                                localtable.put(XMLTools.LOCAL, local);
  -                            }
  +                            localtable.put(XMLTools.NAME_OF, file.getName());
  +                            localtable.put(XMLTools.FILE_PATH, 
file.getPath());
   
                               // Execute the class!
                               cmd.execute(localtable);
  -
                           } catch (Exception e) {
  -                            System.out.println("Error Adding File: " + 
files.getName());
  -                            //System.out.println(e);
  +                            System.out.println("Error Adding File: " + 
file.getName());
  +                            // System.out.println(e);
                               continue;
                           }
                       } else
  
  
  
  1.50      +4 -1      xml-xindice/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/xml-xindice/status.xml,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- status.xml        28 Sep 2004 13:17:39 -0000      1.49
  +++ status.xml        29 Oct 2004 18:52:23 -0000      1.50
  @@ -73,7 +73,10 @@
       </todo>
   
       <changes>
  -        <release version="1.1b5-dev" date="September 28 2004">
  +        <release version="1.1b5-dev" date="October 29 2004">
  +            <action dev="VG" type="fix" due-to="Daniel Migowski">
  +                Fixed memory leak in command line tool, addmultiple command.
  +            </action>
               <action dev="VG" type="fix" fixes-bug="31205" due-to="Tim 
O'Brien">
                   Fixed bug in xindice.bat, support JAVA_HOME with spaces.
               </action>
  
  
  



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe