Interface FileContents
- Since:
- 6.1
- 
Method SummaryModifier and TypeMethodDescriptionProvider<byte[]> Gets a provider of the entire file contents as a single byte array.Gets a provider of the entire file contents as a single String.
- 
Method Details- 
getAsTextGets a provider of the entire file contents as a single String.The file is read only once and only when the value is requested for the first time. The returned provider won't have a value, i.e., Provider.isPresent()will returnfalsewhen:- the underlying file does not exist;
- this FileContentsis connected to aProvider<RegularFile>with no value;
 When the underlying file exists but reading it fails, the ensuing exception is permanently propagated to callers of Provider.get(),Provider.getOrElse(T),Provider.getOrNull()andProvider.isPresent().- Returns:
- provider of the entire file contents as a single String.
 
- 
getAsBytesProvider<byte[]> getAsBytes()Gets a provider of the entire file contents as a single byte array.The file is read only once and only when the value is requested for the first time. The returned provider won't have a value, i.e., Provider.isPresent()will returnfalsewhen:- the underlying file does not exist;
- this FileContentsis connected to aProvider<RegularFile>with no value;
 When the underlying file exists but reading it fails, the ensuing exception is permanently propagated to callers of Provider.get(),Provider.getOrElse(T),Provider.getOrNull()andProvider.isPresent().- Returns:
- provider of the entire file contents as a single byte array.
 
 
-