What's the difference between a nested path and fileset?

Dmitry picture Dmitry · Jul 1, 2011 · Viewed 9.8k times · Source

I have been googling for the "Differences between fileset and path" article for some time, but have found nothing useful. For example, what is the difference between the following (say, there is a someDir directory, which contains .jar files and has no subdirectories):

<path id="somePathId">
    <pathelement path="someDir"/>
</path>

<path id="someId">
  <path refid="somePathId" />
</path>

and

<path id="someId">
  <fileset dir="someDir">
     <include name="*.*">
  </fileset>
</path>

?

Answer

Arpit picture Arpit · Jul 1, 2011

The major difference between a <path> and a <fileset> is that in <fileset> you can specify if you want to include or exclude certain type of files (Basically, its a group of files within a path... not necessary all the files), for eg:

<path id="someId">
  <fileset dir="someDir">
     <include name="*.java">
     <include name="*.properties">
  </fileset>
</path>