Five Stars

Global Variable for Directory Name

Is there a global variable to get the Directory Name in tCreateTemporaryFile component?

I see tCreateTemporaryFile_1_FILEPATH but there is no variable for Directory.

 

  • Big Data
1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: Global Variable for Directory Name

You already have all the info you need.

If I assume your tCreateTemporaryFile component is named tCreateTemporaryFile_1 and that you are using a Windows system (for the path separators "\"), the code you will need is below.... 

String directory =
((String)globalMap.get("tCreateTemporaryFile_1_FILEPATH")).substring(0, ((String)globalMap.get("tCreateTemporaryFile_1_FILEPATH")).lastIndexOf("\\"));
Rilhia Solutions
3 REPLIES
Ten Stars

Re: Global Variable for Directory Name

You already have all the info you need.

If I assume your tCreateTemporaryFile component is named tCreateTemporaryFile_1 and that you are using a Windows system (for the path separators "\"), the code you will need is below.... 

String directory =
((String)globalMap.get("tCreateTemporaryFile_1_FILEPATH")).substring(0, ((String)globalMap.get("tCreateTemporaryFile_1_FILEPATH")).lastIndexOf("\\"));
Rilhia Solutions
Five Stars

Re: Global Variable for Directory Name

Thanks,

 

It's good trick. Smiley Happy

 

I wish there was a global variable name for the same something like tCreateTemporaryFile_1_DIRECTORY, as we have "tCreateTemporaryFile_1_FILEPATH"

 

Ten Stars

Re: Global Variable for Directory Name

Yo could always set the directory using a variable. Then you would have access to change it as well as see what it contains

Rilhia Solutions