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

  • Home
  • SEARCH
  • 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 5993871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:44:14+00:00 2026-05-22T23:44:14+00:00

Not sure if there’s documentation out there specifically for this, couldn’t find it after

  • 0

Not sure if there’s documentation out there specifically for this, couldn’t find it after perusing the ant docs and experimenting a bit, but the main just is this:

Let’s say in my Ant build I want to collect all the images in a certain folder and all subfolders in that folder so I can run them through ImageMagick to convert and resize for mobile images. I use

<apply executable="\pathtoImageMagick\convert">
  <fileset dir="${from.dir}/${dir.publish}/${dir.images}" />
  <srcfile />
  <arg value="-resize" />
  <arg value="25%" />
  <targetfile />
  <mapper type="glob" from="*" to="${from.dir}/${dir.publish}/${dir.images}/mobile.*" />
</apply>

This works for first-level files, such that beside test.jpg I get mobile.test.jpg.

Unfortunately, if I have an image in a subfolder, say test.jpg in the folder ${from.dir}/${dir.publish}/${dir.images}/home and I want it to go to ${from.dir}/${dir.publish}/${dir.images}/home/mobile.test.jpg, how do I do this? It tried to create ${from.dir}/${dir.publish}/${dir.images}/mobile.home/test.jpg, which isn’t correct.

Any ideas from someone who has experience with Ant and mapper? Greatly appreciated.

  • 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-05-22T23:44:15+00:00Added an answer on May 22, 2026 at 11:44 pm

    Glob mapping isn’t useful here, because you want to interpose something in the middle of the matched ‘atom’. There is an example in the Ant documentation of this type of mapping that uses a regexpmapper, something like:

    <mapper type="regexp" from="(.*)/([^/]+)" to="\1/mobile.\2" />
    

    The from says: grab the directory path to \1, grab the filename to \2. Then in the to the prefix is inserted.

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

Sidebar

Related Questions

Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
I'm sure there's a simple answer to this... or not: I have a site
I'm sure there's a clean way to do this, but I'm probably not using
Specifically in JAX-RS (I'm not sure that is relevant) there are methods that allow
I'm not sure this is possible, but is there a syntax to be used
This is a bit curly, and I am not sure there is an answer.
This works, but I'm not sure why (and I'm fairly sure there's a smarter
I'm not sure there is this exact situation in another question, so sorry if
I'm not sure if there is a difference in these two methods. If so,
I'm not sure if there is a proper term for what I want to

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.