Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

searching for *orm.xml files

 
aydeniz kirmizi
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could you please give some advice on how to search for all the *orm.xml files in "WEB-INF"?

basically want to find: *\WEB-INF\*orm.xml

any suggestion is appreciated.

thanks
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4319
236
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it with general file manipulation functions on java.io.File class. However, you should take it a note that attempting to do so makes your web application less portable and less deployable. You can't be certain that you will always have the access to the underneath file system. If you application gets WAR'ed, or if the presence of a security manager prevents access to the file system, your search operation is likely to be failed.

A better way is to rethink why you really need to have such operations to be performed. If you are the one who develops your web application, you should already know the exact file names, so you can fetch them through getResourceAsStream(). If those files are something you are designed to be generated and persisted at the run time of the application, you are probably having a bad architecture.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic