Extract iso file using Groovy to a specific path

Dan27
Contributor
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

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 Leaders.
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

Suggest an answer

Log in or Sign up to answer