The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Extract iso file using Groovy to a specific path

Dan27
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 15, 2020

Hello,

I have a script that gets files from a path. (this script works perfectly)

I would like to extract the iso fiels to a path I need to give the script.

Is it possible? and how?

 

This is my script:

def list = []

//get iso files
def dir = new File("xxxx/xxx/xxxx/xxxx"+issue.getSummary()+"/yyyy/yyyy")
dir.eachFileRecurse (FileType.FILES) { file ->
list << file
}

for(def i=0;i<list.size();i++)
{
boolean flag=true;
def z=list[i].toString().length();
def counter=0;
while(list[i].toString()[z-1]!='/')
{
counter++;
z--;
}
def summary = list[i].toString().substring(list[i].toString().length()-counter,list[i].toString().length());
log.warn summary;

//file inside ends with iso
if(summary.toString().endsWith("iso"))
{

EXTRACT THE ISO FILE TO SPECIFIC PATH

}

 

Thank you

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
mogavenasan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 6, 2021

Hi @Dan27,

You can find most of the code to extract an ISO file at Exploring the ISO File Format in JavaScript, which should be highly compatible with Groovy.

OR

You can design your Groovy script to execute OS-level commands:

I hope that this helps.

Thanks,
Moga