Record Class FileResourceConfig
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.fileresources.FileResourceConfig
public record FileResourceConfig(boolean httpEnabled, boolean requireHttps, boolean gzip, @Nullable String mimeTypeOverride, @NonNull com.google.common.collect.ImmutableMap<String,String> headers, @NonNull PermissionsConfig requiredPermissions)
extends Record
Per-resource HTTP exposure configuration for a file resource. See RFC-31.
When httpEnabled is false (the default), the resource is invisible to the
public-facing servlet (any request returns 404). When true, the remaining fields control how the
resource is served.
headers are arbitrary static response headers applied to every response. A small set
of headers managed by the servlet itself (Content-Type, Content-Encoding,
Content-Length, ETag, Accept-Ranges, Content-Range) cannot be overridden
via this map; attempts to do so are dropped at serving time. Mime-type changes go through mimeTypeOverride instead.
-
Constructor Summary
ConstructorsConstructorDescriptionFileResourceConfig(boolean httpEnabled, boolean requireHttps, boolean gzip, @Nullable String mimeTypeOverride, @NonNull com.google.common.collect.ImmutableMap<String, String> headers, @NonNull PermissionsConfig requiredPermissions) Creates an instance of aFileResourceConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic FileResourceConfigdefaults()final booleanIndicates whether some other object is "equal to" this one.static FileResourceConfigfromJsonTree(@Nullable com.inductiveautomation.ignition.common.gson.JsonElement json) booleangzip()Returns the value of thegziprecord component.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.booleanReturns the value of thehttpEnabledrecord component.@Nullable StringReturns the value of themimeTypeOverriderecord component.@NonNull PermissionsConfigReturns the value of therequiredPermissionsrecord component.booleanReturns the value of therequireHttpsrecord component.com.inductiveautomation.ignition.common.gson.JsonElementfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FileResourceConfig
public FileResourceConfig(boolean httpEnabled, boolean requireHttps, boolean gzip, @Nullable String mimeTypeOverride, @NonNull com.google.common.collect.ImmutableMap<String, String> headers, @NonNull PermissionsConfig requiredPermissions) Creates an instance of aFileResourceConfigrecord class.- Parameters:
httpEnabled- the value for thehttpEnabledrecord componentrequireHttps- the value for therequireHttpsrecord componentgzip- the value for thegziprecord componentmimeTypeOverride- the value for themimeTypeOverriderecord componentheaders- the value for theheadersrecord componentrequiredPermissions- the value for therequiredPermissionsrecord component
-
-
Method Details
-
defaults
- Returns:
- a config with all features disabled. The resource is not exposed via HTTP.
-
toJsonTree
public com.inductiveautomation.ignition.common.gson.JsonElement toJsonTree() -
fromJsonTree
public static FileResourceConfig fromJsonTree(@Nullable com.inductiveautomation.ignition.common.gson.JsonElement json) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
httpEnabled
public boolean httpEnabled()Returns the value of thehttpEnabledrecord component.- Returns:
- the value of the
httpEnabledrecord component
-
requireHttps
public boolean requireHttps()Returns the value of therequireHttpsrecord component.- Returns:
- the value of the
requireHttpsrecord component
-
gzip
public boolean gzip()Returns the value of thegziprecord component.- Returns:
- the value of the
gziprecord component
-
mimeTypeOverride
Returns the value of themimeTypeOverriderecord component.- Returns:
- the value of the
mimeTypeOverriderecord component
-
headers
-
requiredPermissions
Returns the value of therequiredPermissionsrecord component.- Returns:
- the value of the
requiredPermissionsrecord component
-