The moose likes Jython/Python and the fly likes Jython to read contents of directory or folder Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Languages » Jython/Python
Reply Bookmark "Jython to read contents of directory or folder" Watch "Jython to read contents of directory or folder" New topic
Author

Jython to read contents of directory or folder

R Schroeter
Greenhorn

Joined: Sep 18, 2007
Posts: 4
I want Jython to read the contents of a directory or folder, to display what folder or directories are in it, and then to use those names in my program.

------------------------------------------------
I am given the following:

1. Consider this folder structure:

C:/_rob/profile1/plugin-cfg.xml
C:/_rob/profile2/plugin-cfg.xml
C:/_rob/profile3/plugin-cfg.xml

2. I need to read each plugin-cfg.xml.
3. I don't know the NAME of the folders in _rob, NOR do I know how many folders there are in _rob.

I do know that each will have a plugin-cfg.xml.



[ September 18, 2007: Message edited by: Rob schroeter ]

[ September 18, 2007: Message edited by: Rob schroeter ]
[ September 18, 2007: Message edited by: Rob schroeter ]
R Schroeter
Greenhorn

Joined: Sep 18, 2007
Posts: 4
Not much help out there for jython. Figured this out by a lot of painful trial and error. Hope this helps someone.

Roldson Isria
Greenhorn

Joined: Oct 31, 2009
Posts: 2
Use Print directory to print the directory listing to a file..

Download Free : http://www.print-directory.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jython to read contents of directory or folder
 
Similar Threads
How to disable JSP Page serving in WebSphere
how to interact with file system
Multiple Hibernate.cfg.xml problems
JSUnit Eclipse Plugin ?
Running a Java Process