Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
n999
Contributor II
Contributor II

Get current project directory

Hello

I am using the Talend Studio with Git.

we are using one git repository per project.

 

When I checkout a project and create a local branch it seems to create a folder called 

 

/Users/me/talend-workspace/.repositories/1942550470/branches/develop/TESTPROJECT

 

I was wondering if I can get this file location through the studio?

 

Looking through system envs and properties I can see that I get a 

 

HOME=/Users/me

 

env but not much else.

 

Is there a way of getting more/all of this path programmatically....?

seems impossible to construct given the numerical folder....?

 

cheers

 

n9999

Labels (1)
6 Replies
Anonymous
Not applicable

Hi
Can i know why you need to get this path?

Regards
Shong
n999
Contributor II
Contributor II
Author

Hi.

I would like to load some part of my context (Project wide properties that
are fixed across environments) from an external file at the root of my git
repository.


Cheers

Nomit
Anonymous
Not applicable

Hi Nomit
I have asked to our developers and was told that it is impossible to get this path programmatically in a job. For shared property file, we would suggest to put it to a server like FTP server, S3 server etc, download the file and load the value of context variable in the beginning of job, or store the value in database.

Regards
Shong

Askelia
Contributor II
Contributor II

That would be 

System.getProperty("user.dir")

 

n999
Contributor II
Contributor II
Author

That gives you the folder of where your talend runtime is but not necessarily where your workspace/projects are.

LouisM1
Contributor
Contributor

Hi, in case anyone still needs this (we did !), you can get this directory by accessing the system properties :

System.getProperty("java.class.path")

 

Inside the classpath are several semicolon separated folders, one of which contains the

/Users/me/talend-workspace/.repositories/1942550470/branches/develop/TESTPROJECT

directory

 

Cheers !