Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/165#discussion_r18288249
--- Diff:
software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
---
@@ -332,74 +397,28 @@ public int copyTemplate(File template, String target)
{
/**
* @param template URI of file to template and copy, e.g. file://..,
http://.., classpath://..
- * @param target Destination on server. Will be prefixed with the
entity's
- * {@link #getRunDir() run directory} if relative.
+ * @param target Destination on server.
* @return The exit code of the SSH command run.
*/
public int copyTemplate(String template, String target) {
- return copyTemplate(template, target, ImmutableMap.<String,
String>of());
+ return copyTemplate(template, target, false, ImmutableMap.<String,
String>of());
}
/**
* @param template URI of file to template and copy, e.g. file://..,
http://.., classpath://..
- * @param target Destination on server. Will be prefixed with the
entity's
- * {@link #getRunDir() run directory} if relative.
+ * @param target Destination on server.
* @param extraSubstitutions Extra substitutions for the templater to
use, for example
* "foo" -> "bar", and in a template ${foo}.
* @return The exit code of the SSH command run.
*/
- public int copyTemplate(String template, String target, Map<String, ?>
extraSubstitutions) {
- // prefix with runDir if relative target
- String dest = target;
- if (!Os.isAbsolutish(target)) {
- dest = Os.mergePathsUnix(getRunDir(), target);
- }
-
+ public int copyTemplate(String template, String target, boolean
createParent, Map<String, ?> extraSubstitutions) {
String data = processTemplate(template, extraSubstitutions);
- int result = getMachine().copyTo(new StringReader(data), dest);
- if (log.isDebugEnabled())
- log.debug("Copied filtered template for {}: {} to {} - result
{}", new Object[] { entity, template, dest, result });
- return result;
- }
-
- /**
- * Templates all resources in the given map, then copies them to the
driver's {@link #getMachine() machine}.
- * @param templates A mapping of resource URI to server destination.
- * @see #copyTemplate(String, String)
- */
- public void copyTemplates(Map<String, String> templates) {
--- End diff --
Do we need to `@Deprecate` `copyTemplates` and `copyResources`, rather than
deleting now?
---
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.
---