commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/example ShowProperties.java
Date Thu, 27 May 2004 20:06:56 GMT
imario      2004/05/27 13:06:56

  Modified:    vfs/src/java/org/apache/commons/vfs/example
                        ShowProperties.java
  Log:
  show the first 5 children-names of an folder
  
  Revision  Changes    Path
  1.4       +11 -2     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/example/ShowProperties.java
  
  Index: ShowProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/example/ShowProperties.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ShowProperties.java	26 May 2004 08:22:07 -0000	1.3
  +++ ShowProperties.java	27 May 2004 20:06:56 -0000	1.4
  @@ -72,7 +72,16 @@
                       }
                       else if (file.getType().equals(FileType.FOLDER) && file.isReadable())
                       {
  -                        System.out.println("Directory with " + file.getChildren().length
+ " files");
  +                        FileObject[] children = file.getChildren();
  +                        System.out.println("Directory with " + children.length + " files");
  +                        for (int iterChildren = 0; iterChildren < children.length; iterChildren++)
  +                        {
  +                            System.out.println("#" + iterChildren + ": " + children[iterChildren].getName());
  +                            if (iterChildren > 5)
  +                            {
  +                                break;
  +                            }
  +                        }
                       }
                       System.out.println("Last modified: " + DateFormat.getInstance().format(new
Date(file.getContent().getLastModifiedTime())));
                   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message