-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from MCMicS/bugfix/101
Improve usage of targetLocation if renameFiles and flattenFiles is used
- Loading branch information
Showing
4 changed files
with
96 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 28 additions & 1 deletion
29
src/main/resources/sp/sd/fileoperations/FileCopyOperation/help-sourceCaptureExpression.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
<div> | ||
Java-style regular expression that is run against the full path of each | ||
Java-style regular expression that is run against the workspace relative path of each | ||
matching source file. This should be used to capture parts of the path that | ||
will be used in the target name expression to make each file name unique | ||
across all subdirectories. | ||
If path not match the regex the file is copied directly to the target location. | ||
If the includes path is not handled within the regex the sub-directory structure will be preserved. | ||
<p> | ||
<strong>Example:</strong><br/> | ||
<code> | ||
<pre> | ||
// folllowing structure: | ||
// dir1/info-app.txt | ||
// dir1/error-app.txt | ||
fileOperations([fileCopyOperation( | ||
includes: '**/dir1/*.txt', | ||
targetLocation: 'logs/', | ||
flattenFiles: true, | ||
renameFiles: true, | ||
sourceCaptureExpression: 'dir1/(.*)-app\\.txt$', | ||
targetNameExpression: '$1.log') | ||
]) | ||
</pre> | ||
</code> | ||
will result in: | ||
<code> | ||
<pre> | ||
logs/info.log | ||
logs/error.log | ||
</pre> | ||
</code> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters