Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9008811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:01:55+00:00 2026-06-16T02:01:55+00:00

I am having a bit of trouble getting my groovy code to work properly

  • 0

I am having a bit of trouble getting my groovy code to work properly in Jenkins using the Dynamic choice parameter. We currently have a folder that contains a lot of properties files for various environments. The following groovy code returns a list of all the file names correctly, however it is appending the file extension which is unneeded.

    Arrays.asList(new File("path").list())

How would I change that to only list .xml files and not append the file extension in the list. I’ve found some examples of this while searching, but for some reason when I try some of these examples it isn’t populating the list.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:01:57+00:00Added an answer on June 16, 2026 at 2:01 am

    You mean like:

    new File( 'path' ).list()
                      .findAll { it.endsWith( '.xml' ) }
                      .collect { it[ 0..-5 ] }
    

    That gets the list of files (as Strings), keeps those that end with .xml, then removes the .xml off the end

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a bit of trouble getting Gravatars to work properly: When I
Having a bit of trouble getting my URLs to work properly. The URL looks
I am having a bit of trouble getting this c# code to work I
I'm having a bit of trouble getting my form validation to work. As of
I'm currently working with PowerPoint in VB.NET and having a bit of trouble getting
Having a bit of trouble using the List.Find with a custom predicate i have
Having a bit of trouble getting this right... The main objective is to have
I'm having a tad bit of trouble getting the jQuery Form Plugin to work
Hey guys I'm having a bit of trouble getting my htaccess to redirect properly
I'm having a bit of trouble getting some nested, containerless foreach bindings to work.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.