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
Post a Comment