java - retrieve part of Linux directory path -


i getting value of linux environment variable in java code follows:

string path = getenv("my_home")  //my_home corresponds mydir/myproject/proj/landing_page/home 

i want write method returns absolute directory path- mydir/myproject/logs using my_home environment variable.

can please suggest how can retrieve 'mydir/myproject/'part of path in my_home?

maybe looking file's getparentfile method:

new file(getenv("my_home")).getparentfile().getabsolutepath() 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -