• 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

Path issue

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java class that resides inside com.pappu.kumar package , inside my web-app (name=test). So the structure is something like :
test
|
|--jsp
|
|--files
|
|--WEB-INF
|
|--lib
|--classes
|--com
|--pappu
|--kummar
|-CreateFile.class
Now in CreateFile.class , i try to create a file . What path should i give so that i can create the file in the "files" directory , i would like to use a way that works both on unix and windows. And if its not possible to create under "files" , whats the easiest way to create the file in some folder ??
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java's Path syntax is OS independant :

is a good path for both systems, windows and unix.
The question is what is the first class you launch ?
I suppose it's Tomcat application server , in
which case all paths are relative to root of server.
 
Evil is afoot. But this tiny ad is just an ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic