Class CutDirsMapper
java.lang.Object
org.apache.tools.ant.types.mappers.CutDirsMapper
- All Implemented Interfaces:
- FileNameMapper
A mapper that strips of the a configurable number of leading
 directories from a file name.
 
This mapper was inspired by a user-list thread that mentioned wget's --cut-dirs option.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionString[]mapFileName(String sourceFileName) Returns an array containing the target filename(s) for the given source file.voidsetDirs(int dirs) The number of leading directories to cut.voidEmpty implementation.voidEmpty implementation.
- 
Constructor Details- 
CutDirsMapperpublic CutDirsMapper()
 
- 
- 
Method Details- 
setDirspublic void setDirs(int dirs) The number of leading directories to cut.- Parameters:
- dirs- int
 
- 
setFromEmpty implementation.- Specified by:
- setFromin interface- FileNameMapper
- Parameters:
- ignore- ignored.
 
- 
setToEmpty implementation.- Specified by:
- setToin interface- FileNameMapper
- Parameters:
- ignore- ignored.
 
- 
mapFileNameReturns an array containing the target filename(s) for the given source file.if the given rule doesn't apply to the source file, implementation must return null. SourceFileScanner will then omit the source file in question. .- Specified by:
- mapFileNamein interface- FileNameMapper
- Parameters:
- sourceFileName- the name of the source file relative to some given basedirectory. Might be- nullfor resources that don't provide a name.
- Returns:
- an array of strings if the rule applies to the source file, or null if it does not.
 
 
-