avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui GuiUtils.java FtpFileTableModel.java
Date Sun, 10 Mar 2002 06:10:36 GMT
rana_b      02/03/09 22:10:36

  Modified:    ftpserver/src/java/org/apache/avalon/ftpserver/gui
                        GuiUtils.java FtpFileTableModel.java
  Log:
  setting max size in file table model
  
  Revision  Changes    Path
  1.7       +1 -1      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/GuiUtils.java
  
  Index: GuiUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/GuiUtils.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GuiUtils.java	6 Mar 2002 13:53:20 -0000	1.6
  +++ GuiUtils.java	10 Mar 2002 06:10:36 -0000	1.7
  @@ -48,7 +48,7 @@
               is = SELF_REF.getClass().getClassLoader().getResourceAsStream(imgResource);
               if (is != null) {
                   out = new ByteArrayOutputStream();
  -                byte buff[] = new byte[1024];
  +                byte buff[] = new byte[2048];
                   int count = 0;
                   while ( -1 != (count = is.read(buff)) ) {
                       out.write(buff, 0, count);
  
  
  
  1.2       +8 -4      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpFileTableModel.java
  
  Index: FtpFileTableModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpFileTableModel.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FtpFileTableModel.java	6 Mar 2002 13:53:20 -0000	1.1
  +++ FtpFileTableModel.java	10 Mar 2002 06:10:36 -0000	1.2
  @@ -22,8 +22,8 @@
   public
   class FtpFileTableModel extends AbstractTableModel {
       
  +    private final static int MAX_SIZE = 1000;
       private final static SimpleDateFormat DATE_FMT = new SimpleDateFormat("MM/dd HH:mm:ss");
  -    
       private final static String[] COL_NAMES = {"File", 
                                                  "User", 
                                                  "Time"};    
  @@ -136,12 +136,16 @@
           entry.userName = user.getName();
           entry.date = DATE_FMT.format(new Date());
           
  -        int sz = 0;
  +        int sz = mEntryList.size();
  +        if ( (MAX_SIZE > 0) && (sz >= MAX_SIZE) ) {
  +            reset();
  +            sz = 0;
  +        }
  +        
           synchronized(mEntryList) {
               mEntryList.add(entry);
  -            sz = mEntryList.size();
  +            ++sz;
           }
  -        
           fireTableRowsInserted(sz, sz);
       }  
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message