minor fix: LicenseSpecs

Original commit: elastic/x-pack-elasticsearch@5c9e0b3ad0
This commit is contained in:
Areek Zillur 2014-10-27 13:18:36 -04:00
parent d1afd77bde
commit 7f11de275f
2 changed files with 2 additions and 6 deletions

View File

@ -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<ESLicense> fromSource(String content) throws IOException, ParseException {
return fromSource(content.getBytes(LicensesCharset.UTF_8));
}
public static Set<ESLicense> fromSource(byte[] bytes) throws IOException, ParseException {
return fromXContents(XContentFactory.xContent(bytes).createParser(bytes));
}

View File

@ -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]);