Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/106#discussion_r15807929
--- Diff: core/src/main/java/brooklyn/util/file/ArchiveBuilder.java ---
@@ -178,28 +175,32 @@ public ArchiveBuilder add(File file) {
}
/**
- * Add the file located at the {@code filePath}, relative to the
{@code baseDir},
+ * Add the file located at the {@code fileSubPath}, relative to the
{@code baseDir} on the local system,
* to the archive.
* <p>
- * Uses the {@code filePath} as the name of the file in the archive.
Note that the
- * file is found by concatenating the two path components using {@link
Os#mergePaths(String...)}
- * which may not behave as expected if the {@code filePath} is
absolute or points to
- * a location above the current directory.
+ * Uses the {@code fileSubPath} as the name of the file in the
archive. Note that the
+ * file is found by concatenating the two path components using {@link
Os#mergePaths(String...)},
+ * thus {@code fileSubPath} should not be absolute or point to a
location above the current directory.
* <p>
* Use {@link #entry(String, String)} directly or {@link
#entries(Map)} for complete
* control over file locations and names in the archive.
*
* @see #entry(String, String)
*/
- public ArchiveBuilder addRelativeToBaseDir(String baseDir, String
filePath) {
+ public ArchiveBuilder addFromLocalBaseDir(File baseDir, String
fileSubPath) {
--- End diff --
This is certainly an improvement. However, is there still any confusion
with parameter orderings in the methods - e.g. `ArchiveBuilder entry(String
entryPath, File file)` looks to be the other way round from the args in things
like `addFromLocalBaseDir`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---