Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a java system property for the C: drive (or unix equivalent)?

I have an ant build I'm trying to customize so that the files being built are deployed outside of my project folder.

The Java System properties give me access to ${user.home} but I need to be higher "Machintosh HD/Applications" to be exact.

How can I point ant to a directory higher than user.home?

like image 209
JLeonard Avatar asked Dec 17 '22 15:12

JLeonard


2 Answers

You can just use forward slashes (Unix style) and just start your paths with /:

<property name="root.dir" location="/"/>

and it will resolve the root of the default drive appropriate to your OS platform (e.g. C:\ on Windows and / on Unix).

<property name="tmp.dir" location="/tmp"/>

will resolve to C:\tmp or /tmp, depending on your platform.

like image 101
Mads Hansen Avatar answered Dec 21 '22 09:12

Mads Hansen


Try have a look on File.listRoots(). Combining with ANT java task might get the desired result.

like image 37
Jan Zyka Avatar answered Dec 21 '22 11:12

Jan Zyka