ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Burgess, Benjamin" <>
Subject RE: stcheckout, unable to excludes directories
Date Mon, 30 Jun 2008 18:55:02 GMT
Purely looking at the task's code with no verifications or running it locally, I am pretty
sure it was never meant to work with directories in the patterns.  In,
in the processFile method, at the top it has:

String filename = eachFile.getName();
File localFile = new File(targetFolder, filename);
if (!shouldProcess(filename)) {

but this will only compare the name of the file to the patterns, not the full repository path.

To change it to compare paths, you would instead change these lines to do this:

File localFile = new File(targetFolder, eachFile.getName());
if (!shouldProcess(getFullRepositoryPath(eachFile))) {

This should change it to use the whole path when comparing patterns without having any other
affects on the task.  Also, the documentation doesn't make it extremely clear, but I am assuming
that it is the repository path that patterns should be based off of as opposed to the local
file system path.  In this case, the repository sometimes uses '/' and other times '\' for
folder separators in the path.  Therefore, really the getFullRepositoryPath method in TreeBasedTask
could be made to replace all '\' and '/' with File.seperator (to standardize what the server
returns) and the matchPatterns method in the would need to be changed to
use DirectoryScanner.matchPath instead of just DirectoryScanner.match - of course this would
impact the other StarTeam tasks which could undergo similar enhancements.

Ben Burgess

-----Original Message-----
From: Simple Easy [] 
Sent: Thursday, June 26, 2008 4:26 AM
Subject: stcheckout, unable to excludes directories

 <stcheckout servername="${stserver}"

                excludes="docs/*" />
It still checking out all the files in "docs" folder. 


This message, including any attachments, contains confidential information intended 
for a specific individual and purpose, and is protected by law. If you are not the intended

recipient, please contact the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of this message, or
the taking of any action based on it, is strictly prohibited.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message