public class ConfigTreePropertySource extends EnumerablePropertySource<PathSE> implements OriginLookup<StringSE>
PropertySource
。PropertySource
は、指定されたソースディレクトリを再帰的にスキャンし、見つかった各ファイルのプロパティを公開します。プロパティ名はファイル名になり、プロパティ値はファイルの内容になります。 ディレクトリは、ソースが最初に作成されたときにのみスキャンされます。ディレクトリは更新を監視されていないため、ファイルを追加または削除しないでください。ただし、プロパティソースが ConfigTreePropertySource.Option.ALWAYS_READ
オプションで作成されている限り、ファイルの内容を更新できます。ネストされたディレクトリはソースに含まれていますが、パス区切り文字として '/'
ではなく '.'
が使用されています。
プロパティ値は ConfigTreePropertySource.Value
インスタンスとして返され、InputStreamSource
または CharSequence
SE のいずれかとして扱うことができます。さらに、ApplicationConversionService
で構成された Environment
とともに使用する場合、プロパティ値を String
または byte[]
に変換できます。
このプロパティソースは通常、Kubernetes configMap
ボリュームマウントを読み取るために使用されます。
修飾子と型 | クラスと説明 |
---|---|
static class | ConfigTreePropertySource.Option プロパティソースオプション。 |
static interface | ConfigTreePropertySource.Value プロパティファイルの内容を公開するプロパティソースから返される値。 |
PropertySource.StubPropertySource
logger, name, source
コンストラクターと説明 |
---|
ConfigTreePropertySource(StringSE name, PathSE sourceDirectory) 新しい ConfigTreePropertySource インスタンスを作成します。 |
ConfigTreePropertySource(StringSE name, PathSE sourceDirectory, ConfigTreePropertySource.Option... options) 新しい ConfigTreePropertySource インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
Origin | getOrigin(StringSE name) 指定されたキーの起源を返すか、起源を特定できない場合は null を返します。 |
ConfigTreePropertySource.Value | getProperty(StringSE name) |
StringSE[] | getPropertyNames() |
boolean | isImmutable() このルックアップが不変で、内容が決して変更されない場合、 true を返します。 |
containsProperty
equals, getName, getSource, hashCode, named, toString
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
getOrigin, getPrefix
public ConfigTreePropertySource(StringSE name, PathSE sourceDirectory)
ConfigTreePropertySource
インスタンスを作成します。name
- プロパティソースの名前 sourceDirectory
- 基になるソースディレクトリ public ConfigTreePropertySource(StringSE name, PathSE sourceDirectory, ConfigTreePropertySource.Option... options)
ConfigTreePropertySource
インスタンスを作成します。name
- プロパティソースの名前 sourceDirectory
- 基になるソースディレクトリ options
- プロパティソースオプション public StringSE[] getPropertyNames()
EnumerablePropertySource<PathSE>
の getPropertyNames
public ConfigTreePropertySource.Value getProperty(StringSE name)
PropertySource<PathSE>
の getProperty
public Origin getOrigin(StringSE name)
OriginLookup
null
を返します。OriginLookup<StringSE>
の getOrigin
name
- 検索するキー null
の起源 public boolean isImmutable()
OriginLookup
true
を返します。OriginLookup<StringSE>
の isImmutable