• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generate a file tree structure of a mounted unix file system

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a web application that runs on server X(unix) and it has another unix system mounted on it.

I want to generate the file tree structure of this mounted unix file system and show it on to a web application so that users can select a file and move it onto this current unix machine.

I know this sounds stupid and you may want to say why cant we directly copy the file, I am doing a proof of concept and using this as a basis.

Thanks,
Nikhil
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't sound stupid to me, it sounds like a pretty normal scenario. But anyway... what do you have so far? There's a couple of separate parts to your question, or more, and you've just thrown them all into one post. I'd suggest HTML to display the file system, but maybe you thought of that already. So tell us what you've done and where you are stuck.
 
Nikhil Das Nomula
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Thank you. I agree the question was not directly to the point.

Yes as you mentioned I am going to use HTML to display the file system.

So the point where I am stuck at is

Generate the XML out of the file tree of the mounted linux system
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, then. The first thing you'll want to do is to design the HTML you want to see. (I'm not sure where XML comes into the design -- do you plan to do an XSL transformation to produce the desired HTML?) If you're using Java 7 or later then the Files.walkFileTree is a handy tool to go through your file tree, you can provide a suitable subclass of FileVisitor which builds the HTML or the XML.
 
Nikhil Das Nomula
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well my thought is that I would generate an XML which represents the file tree and then use this to generate the tree in the web-app. I am planning to make the tree a dynamic one and allow user to drill down the file tree by clicking on nodes.

The reason I am not going through java nio's Files.walkFileTree is I want the response to be quick and hence I want to generate the xml when a user logs into the application and use this xml to display the tree structure.
reply
    Bookmark Topic Watch Topic
  • New Topic