lundi 1 janvier 2018

I want to get the root folder in a Path which is stored in a variable using groovy and used this root value in if statement

I want to get the root folder in a Path which is stored in a variable.

b="Sports/Badminton/Players/Saina.txt"

Now i want to copy the file if root is "Sports"

if (b=="Sports")
{
 (new AntBuilder()).copy(file:  ("$gitPath/$file"), tofile:  ("$ServerPath/$file"))  

        }

        else { println "unknown file" }

Aucun commentaire:

Enregistrer un commentaire