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 8342285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:43:28+00:00 2026-06-09T05:43:28+00:00

I am writing an inline javascript in ant. This script will scan a directory

  • 0

I am writing an inline javascript in ant. This script will scan a directory and output the names of files that are not up to date with respect to a given timestamp.

<script language="javascript"> <![CDATA[

  importPackage(Packages.java.lang);
  importPackage(Packages.org.apache.commons.io.FileUtils);
  importClass(Packages.java.io.File);
  importClass(Packages.java.util.Iterator);


  var path = "D:\DirectoryToScan\";
  var timeToCompare = buildServers.getProperty("buildStartTime");

  var invocationTime = new Date(timeToCompare );
  invocationTime = invocationTime.getTime();

  var directoryToSearch = new File(path );
  //CODE BREAKS HERE. NONE OF THE SUBSEQUENT LINES EXECUTE  
  var fileIterator = FileUtils.iterateFiles(directoryToSearch, new String[]{"pdf","html"} , true);


  //iterate through files and directories in builtDocs folder and return false if any of the files is older than invocation time
  while (fileIterator.hasNext()) {
     var doc = fileIterator.next();
     if ((!FileUtils.isFileNewer(doc, invocationTime))) {
        return false;
     }        
  }
]]> </script>

I have noticed that the first call to FileUtils breaks. I also tried using some simple classes but they were not accessible and looks like import statement is not working for custom classes or belong to packages that apparently are not accessible here (such as apache.tools.ant.util.FileUtils).

Is there something that i need to do here to load the classes correctly before accessing them?

  • 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-09T05:43:30+00:00Added an answer on June 9, 2026 at 5:43 am

    The issue was resolved by including the jar file in ant.cmd file.

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

Sidebar

Related Questions

i'm writing some inline javascript. it's not working and i'm not sure why. at
I am trying to create a rule for checkstyle, that will prevent writing inline
I'm just getting started on writing functions instead of writing everything inline. Is this
I'm writing a greasemonkey script that creates an auto-complete search type box which makes
When writing this: 1: inline double f( double arg ) { 2: return arg
SO I am working on writing an inline assembly function in c that reverses
I'm writing a function to parse words inline in a contenteditable div and replace
I am writing a small jQuery plugin to allow inline editing (for my purposes
i'm writing an email template and was told to use only inline css (because
So I'm writing a game in c++ for MS-DOS and I'm including some inline

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.