From 227dbf777a371544b6fb7bd9d6aab3d271bbd84e Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 13 Jun 2012 09:48:51 -0700 Subject: [PATCH] Correct spelled from delimeter to delimiter --- .../BaseContainerIntegrationTest.java | 2 +- .../RunScriptOnNodeAsInitScriptUsingSsh.java | 2 +- .../scriptbuilder/domain/AppendFile.java | 26 +++++++++---------- .../domain/CreateOrOverwriteFile.java | 16 ++++++------ .../scriptbuilder/domain/CreateRunScript.java | 14 +++++----- .../scriptbuilder/domain/Statements.java | 12 ++++----- .../scriptbuilder/domain/SwitchArg.java | 4 +-- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java index ec55d601a5..5ed397cb01 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java @@ -139,7 +139,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { public void testListRootUsesDelimiter() throws InterruptedException { String containerName = getContainerName(); try { - String prefix = "rootdelimeter"; + String prefix = "rootdelimiter"; addTenObjectsUnderPrefix(containerName, prefix); add15UnderRoot(containerName); PageSet container = view.getBlobStore().list(containerName); diff --git a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java index a3e263af23..e2ba40c765 100644 --- a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java +++ b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java @@ -119,7 +119,7 @@ public class RunScriptOnNodeAsInitScriptUsingSsh extends SudoAwareInitManager im ssh.connect(); ssh.exec("rm " + initFile); ssh.exec(Statements.appendFile(initFile, Splitter.on('\n').split(init.render(OsFamily.UNIX)), - AppendFile.DELIMETER + "_" + init.getInstanceName()).render(OsFamily.UNIX)); + AppendFile.DELIMITER + "_" + init.getInstanceName()).render(OsFamily.UNIX)); } ssh.exec("chmod 755 " + initFile); diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java index 2767a50c0d..8fd534c7f5 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java @@ -37,7 +37,7 @@ import com.google.common.collect.Maps; * @author Adrian Cole */ public class AppendFile implements Statement { - public static final String DELIMETER = "END_OF_JCLOUDS_FILE"; + public static final String DELIMITER = "END_OF_JCLOUDS_FILE"; public static Builder builder() { return new Builder(); @@ -46,7 +46,7 @@ public class AppendFile implements Statement { public static class Builder { protected String path; protected Iterable lines = ImmutableSet.of(); - protected String delimeter = DELIMETER; + protected String delimiter = DELIMITER; protected boolean expandVariables; /** @@ -66,10 +66,10 @@ public class AppendFile implements Statement { } /** - * @see AppendFile#getDelimeter() + * @see AppendFile#getDelimiter() */ - public Builder delimeter(String delimeter) { - this.delimeter = delimeter; + public Builder delimiter(String delimiter) { + this.delimiter = delimiter; return this; } @@ -82,19 +82,19 @@ public class AppendFile implements Statement { } public AppendFile build() { - return new AppendFile(path, lines, delimeter, expandVariables); + return new AppendFile(path, lines, delimiter, expandVariables); } } protected final String path; protected final Iterable lines; - protected final String delimeter; + protected final String delimiter; protected final boolean expandVariables; - protected AppendFile(String path, Iterable lines, String delimeter, boolean expandVariables) { + protected AppendFile(String path, Iterable lines, String delimiter, boolean expandVariables) { this.path = checkNotNull(path, "PATH"); this.lines = checkNotNull(lines, "lines"); - this.delimeter = checkNotNull(delimeter, "delimeter"); + this.delimiter = checkNotNull(delimiter, "delimiter"); checkState(Iterables.size(lines) > 0, "you must pass something to execute"); this.expandVariables = expandVariables; } @@ -140,15 +140,15 @@ public class AppendFile implements Statement { for (String line : lines) { hereFile.append('\t').append(line).append("\n"); } - hereFile.append(delimeter).append("\n"); + hereFile.append(delimiter).append("\n"); return hereFile.toString(); } public StringBuilder startHereFile() { StringBuilder hereFile = new StringBuilder().append("cat >> ").append(path); if (expandVariables) - return hereFile.append(" <<-").append(delimeter).append("\n"); - return hereFile.append(" <<-'").append(delimeter).append("'\n"); + return hereFile.append(" <<-").append(delimiter).append("\n"); + return hereFile.append(" <<-'").append(delimiter).append("'\n"); } protected String appendLineToWindowsFile(String line, String path) { @@ -161,4 +161,4 @@ public class AppendFile implements Statement { return String.format("echo %s%s%s >>%s{lf}", quote, line, quote, path); } -} \ No newline at end of file +} diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateOrOverwriteFile.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateOrOverwriteFile.java index 04bb3ab03f..f0eb424a12 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateOrOverwriteFile.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateOrOverwriteFile.java @@ -42,8 +42,8 @@ public class CreateOrOverwriteFile extends AppendFile { } @Override - public Builder delimeter(String delimeter) { - return Builder.class.cast(super.delimeter(delimeter)); + public Builder delimiter(String delimiter) { + return Builder.class.cast(super.delimiter(delimiter)); } @Override @@ -53,13 +53,13 @@ public class CreateOrOverwriteFile extends AppendFile { @Override public CreateOrOverwriteFile build() { - return new CreateOrOverwriteFile(path, lines, delimeter, expandVariables); + return new CreateOrOverwriteFile(path, lines, delimiter, expandVariables); } } - protected CreateOrOverwriteFile(String path, Iterable lines, String delimeter, boolean expandVariables) { - super(path, lines, delimeter, expandVariables); + protected CreateOrOverwriteFile(String path, Iterable lines, String delimiter, boolean expandVariables) { + super(path, lines, delimiter, expandVariables); } @Override @@ -71,8 +71,8 @@ public class CreateOrOverwriteFile extends AppendFile { public StringBuilder startHereFile() { StringBuilder hereFile = new StringBuilder().append("cat > ").append(path); if (expandVariables) - return hereFile.append(" <<-").append(delimeter).append("\n"); - return hereFile.append(" <<-'").append(delimeter).append("'\n"); + return hereFile.append(" <<-").append(delimiter).append("\n"); + return hereFile.append(" <<-'").append(delimiter).append("'\n"); } -} \ No newline at end of file +} diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateRunScript.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateRunScript.java index c48fdbe2c7..50ef817ac5 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateRunScript.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/CreateRunScript.java @@ -49,7 +49,7 @@ import com.google.common.collect.ImmutableList.Builder; * @author Adrian Cole */ public class CreateRunScript extends StatementList { - public final static String DELIMETER = "END_OF_JCLOUDS_SCRIPT"; + public final static String DELIMITER = "END_OF_JCLOUDS_SCRIPT"; final String instanceName; final Iterable exports; final String pwd; @@ -123,7 +123,7 @@ public class CreateRunScript extends StatementList { builder.append("# add runscript footer\n"); Iterable endScript = Splitter.on(ShellToken.LF.to(OsFamily.UNIX)).split( ShellToken.END_SCRIPT.to(OsFamily.UNIX)); - builder.append(appendFile(runScript, endScript, DELIMETER).render(OsFamily.UNIX)); + builder.append(appendFile(runScript, endScript, DELIMITER).render(OsFamily.UNIX)); } private void addUnixRunScript(String runScript, StringBuilder builder) { @@ -138,7 +138,7 @@ public class CreateRunScript extends StatementList { } userCommands.addAll(Splitter.on('\n').split(statement.render(OsFamily.UNIX))); } - builder.append(appendFile(runScript, userCommands.build(), DELIMETER).render(OsFamily.UNIX)); + builder.append(appendFile(runScript, userCommands.build(), DELIMITER).render(OsFamily.UNIX)); } private void addUnixRunScriptHeader(String runScript, StringBuilder builder) { @@ -150,10 +150,10 @@ public class CreateRunScript extends StatementList { beginningOfFile.add(format("PROMPT_COMMAND='echo -ne \\\"\\033]0;%s\\007\\\"'", instanceName)); beginningOfFile.add(Utils.writeZeroPath(OsFamily.UNIX)); beginningOfFile.add(format("export INSTANCE_NAME='%s'", instanceName)); - builder.append(createOrOverwriteFile(runScript, beginningOfFile.build(), DELIMETER).render(OsFamily.UNIX)); + builder.append(createOrOverwriteFile(runScript, beginningOfFile.build(), DELIMITER).render(OsFamily.UNIX)); // expanding variables here. - builder.append(AppendFile.builder().path(runScript).delimeter(DELIMETER).expandVariables(true) + builder.append(AppendFile.builder().path(runScript).delimiter(DELIMITER).expandVariables(true) .lines(Iterables.transform(exports, new Function() { @Override @@ -171,7 +171,7 @@ public class CreateRunScript extends StatementList { if (functionsToWrite.size() > 1) { StringBuilder functions = new StringBuilder(); ScriptBuilder.writeFunctions(functionsToWrite, OsFamily.UNIX, functions); - builder.append(appendFile(runScript, functions.toString(), DELIMETER).render(OsFamily.UNIX)); + builder.append(appendFile(runScript, functions.toString(), DELIMITER).render(OsFamily.UNIX)); } } -} \ No newline at end of file +} diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java index a7d5b8d97b..bfc6df4f4e 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java @@ -65,24 +65,24 @@ public class Statements { return new Call(function, args); } - public static Statement appendFile(String path, String line, String delimeter) { - return AppendFile.builder().path(path).lines(ImmutableSet.of(line)).delimeter(delimeter).build(); + public static Statement appendFile(String path, String line, String delimiter) { + return AppendFile.builder().path(path).lines(ImmutableSet.of(line)).delimiter(delimiter).build(); } public static Statement appendFile(String path, Iterable lines) { return AppendFile.builder().path(path).lines(lines).build(); } - public static Statement appendFile(String path, Iterable lines, String delimeter) { - return AppendFile.builder().path(path).lines(lines).delimeter(delimeter).build(); + public static Statement appendFile(String path, Iterable lines, String delimiter) { + return AppendFile.builder().path(path).lines(lines).delimiter(delimiter).build(); } public static Statement createOrOverwriteFile(String path, Iterable lines) { return CreateOrOverwriteFile.builder().path(path).lines(lines).build(); } - public static Statement createOrOverwriteFile(String path, Iterable lines, String delimeter) { - return CreateOrOverwriteFile.builder().path(path).lines(lines).delimeter(delimeter).build(); + public static Statement createOrOverwriteFile(String path, Iterable lines, String delimiter) { + return CreateOrOverwriteFile.builder().path(path).lines(lines).delimiter(delimiter).build(); } /** diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/SwitchArg.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/SwitchArg.java index 289ecc7243..17841ba31d 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/SwitchArg.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/SwitchArg.java @@ -94,11 +94,11 @@ public class SwitchArg implements Statement, AcceptsStatementVisitor { if (shouldIndent) actionBuilder.append(INDENT); actionBuilder.append(line).append(ShellToken.LF.to(family)); - if (line.indexOf(CreateRunScript.DELIMETER) != -1) { + if (line.indexOf(CreateRunScript.DELIMITER) != -1) { inRunScript = inRunScript ? false : true; } - if (line.indexOf(AppendFile.DELIMETER) != -1) { + if (line.indexOf(AppendFile.DELIMITER) != -1) { inCreateFile = inCreateFile ? false : true; } shouldIndent = !inCreateFile && !inRunScript;