This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to telegram version 4.2 and newest spring boot version
- Loading branch information
1 parent
3bcb567
commit c69d9ba
Showing
3 changed files
with
66 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/github/xabgesagtx/bots/TelegramProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.github.xabgesagtx.bots; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.util.StringUtils; | ||
|
||
@Component | ||
@ConfigurationProperties("telegram") | ||
@Data | ||
class TelegramProperties { | ||
private String externalUrl; | ||
private String internalUrl; | ||
private String keyStore; | ||
private String keyStorePassword; | ||
private String pathToCertificate; | ||
|
||
boolean hasKeyStoreWithPath() { | ||
return hasUrls() && hasKeyStore() && !StringUtils.isEmpty(pathToCertificate); | ||
} | ||
|
||
boolean hasKeyStore() { | ||
return !StringUtils.isEmpty(keyStore) && !StringUtils.isEmpty(keyStorePassword); | ||
} | ||
|
||
boolean hasUrls() { | ||
return !StringUtils.isEmpty(externalUrl) && !StringUtils.isEmpty(internalUrl); | ||
} | ||
|
||
} |