minor fix: LicenseSpecs
Original commit: elastic/x-pack-elasticsearch@5c9e0b3ad0
This commit is contained in:
parent
d1afd77bde
commit
7f11de275f
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue