Skip to content

Commit

Permalink
Use seed 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienlauer committed Nov 29, 2017
1 parent ef76fdd commit d3d324d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version 1.0.1 (2017-11-31)
# Version 1.0.1 (2017-11-29)

* [chg] Update to Seed 3.4.0.

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
<parent>
<groupId>org.seedstack.poms</groupId>
<artifactId>parent-internal</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</parent>

<groupId>org.seedstack.addons.shell</groupId>
<artifactId>shell</artifactId>
<version>1.0.1-SNAPSHOT</version>

<properties>
<seed.version>3.4.0-SNAPSHOT</seed.version>
<seed.version>3.4.0</seed.version>

<compatibility.skip>true</compatibility.skip>
<compatibility.version>1.0.0</compatibility.version>

<bintray.package>shell-addon</bintray.package>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

abstract class AbstractShell implements org.apache.sshd.server.Command, Runnable {
private static final String COMMAND_PATTERN = "([a-zA-Z][a-zA-Z0-9\\-]+:)?[a-zA-Z][a-zA-Z0-9\\-]+";
static final String UTF_8 = "UTF-8";
private final CommandLineParser commandLineParser = new DefaultParser();
InputStream inputStream;
OutputStream outputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class InteractiveShell extends AbstractShell {

@Override
public void start(Environment environment) throws IOException {
errorPrintStream = new PrintStream(errorStream, true);
errorPrintStream = new PrintStream(errorStream, true, UTF_8);

String user = environment.getEnv().get(Environment.ENV_USER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class NonInteractiveShell extends AbstractShell {

@Override
public void start(Environment env) throws IOException {
outputPrintStream = new PrintStream(outputStream, true);
errorPrintStream = new PrintStream(errorStream, true);
outputPrintStream = new PrintStream(outputStream, true, UTF_8);
errorPrintStream = new PrintStream(errorStream, true, UTF_8);

ses = new SubjectAwareExecutorService(Executors.newSingleThreadExecutor());
ses.submit(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package org.seedstack.shell.internal.commands;

import org.apache.commons.beanutils.BeanUtils;
import org.seedstack.seed.command.Argument;
import org.seedstack.seed.command.Command;
import org.seedstack.seed.command.CommandDefinition;

Expand All @@ -17,17 +16,14 @@
*
* @author [email protected]
*/
@CommandDefinition(scope = "", name = "str", description = "Return the argument string")
@CommandDefinition(scope = "", name = "str", description = "Return the argument as a string")
public class StrCommand implements Command {
@Argument(index = 0, description = "The property to get", mandatory = false, defaultValue = "")
private String string;

@Override
public Object execute(Object object) throws Exception {
if (object != null) {
return object.toString();
} else {
return null;
}

return BeanUtils.getProperty(object, string);
}
}

0 comments on commit d3d324d

Please sign in to comment.