@Override
  protected Set<String> requestDo(HInput input, HOutput output) throws IOException {
    int count = input.readLength(0);

    // Read all update dirs names
    Set<String> result = new HashSet<>(count);
    for (int i = 0; i < count; i++) {
      result.add(IOHelper.verifyFileName(input.readString(255)));
    }

    // We're done. Make it unmodifiable and return
    return Collections.unmodifiableSet(result);
  }
示例#2
0
  @LauncherAPI
  public void verify() {
    // Version
    getVersion();
    IOHelper.verifyFileName(getAssetIndex());

    // Client
    VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Profile title can't be empty");
    VerifyHelper.verify(
        getServerAddress(), VerifyHelper.NOT_EMPTY, "Server address can't be empty");
    VerifyHelper.verifyInt(
        getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort());

    //  Updater and client watch service
    update.verifyOfType(ConfigEntry.Type.STRING);
    updateVerify.verifyOfType(ConfigEntry.Type.STRING);
    updateExclusions.verifyOfType(ConfigEntry.Type.STRING);

    // Client launcher
    jvmArgs.verifyOfType(ConfigEntry.Type.STRING);
    classPath.verifyOfType(ConfigEntry.Type.STRING);
    clientArgs.verifyOfType(ConfigEntry.Type.STRING);
    VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty");
  }