diff --git a/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java b/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java index 5ec2cb845f0..512dd3415df 100644 --- a/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java +++ b/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.license.core.DateUtils; import org.elasticsearch.license.core.ESLicense; -import org.elasticsearch.license.core.LicensesCharset; import java.io.IOException; import java.text.ParseException; @@ -43,10 +42,6 @@ public class LicenseSpecs { return builder.build(); } - public static Set fromSource(String content) throws IOException, ParseException { - return fromSource(content.getBytes(LicensesCharset.UTF_8)); - } - public static Set fromSource(byte[] bytes) throws IOException, ParseException { return fromXContents(XContentFactory.xContent(bytes).createParser(bytes)); } diff --git a/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java b/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java index 9ec3694d394..07e9b572d8a 100644 --- a/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java +++ b/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java @@ -11,6 +11,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.license.core.ESLicense; import org.elasticsearch.license.core.ESLicenses; +import org.elasticsearch.license.core.LicensesCharset; import org.elasticsearch.license.licensor.ESLicenseSigner; import org.elasticsearch.license.licensor.LicenseSpecs; @@ -47,7 +48,7 @@ public class LicenseGeneratorTool { switch (command) { case "--license": String licenseInput = args[++i]; - licenseSpecs.addAll(LicenseSpecs.fromSource(licenseInput)); + licenseSpecs.addAll(LicenseSpecs.fromSource(licenseInput.getBytes(LicensesCharset.UTF_8))); break; case "--licenseFile": File licenseFile = new File(args[++i]);