Class ServiceRemoteInclusion
java.lang.Object
eu.cloudnetservice.driver.service.ServiceRemoteInclusion
- All Implemented Interfaces:
eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,,ServiceRemoteInclusion> eu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,,ServiceRemoteInclusion> Cloneable
public final class ServiceRemoteInclusion
extends Object
implements eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,ServiceRemoteInclusion>, Cloneable
An inclusion which can be added to a service and will download a file from the specified url to the given
destination. This can be anything for example a plugin or configuration file.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for a service remote inclusion. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringstatic final eu.cloudnetservice.common.document.property.DocProperty<eu.cloudnetservice.common.document.gson.JsonDocument>A property which can be added to a service inclusion to set the http headers to send when making the download http request.private final eu.cloudnetservice.common.document.gson.JsonDocumentprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance for a service remote inclusion.builder(@NonNull ServiceRemoteInclusion inclusion) Constructs a new builder for a service remote inclusion which has the properties of the given inclusion already set.clone()The target file name of the inclusion download.@NonNull eu.cloudnetservice.common.document.gson.JsonDocumenttoString()url()Get the url to download the remote inclusion from.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow, removeProperty, writeProperty, writePropertyIfAbsent, writePropertyIfAbsent, writePropertyIfPresent, writePropertyIfPresent
-
Field Details
-
HEADERS
public static final eu.cloudnetservice.common.document.property.DocProperty<eu.cloudnetservice.common.document.gson.JsonDocument> HEADERSA property which can be added to a service inclusion to set the http headers to send when making the download http request. All key-value pairs of the given document will be set as headers in the request. -
url
-
destination
-
properties
private final eu.cloudnetservice.common.document.gson.JsonDocument properties
-
-
Constructor Details
-
ServiceRemoteInclusion
private ServiceRemoteInclusion(@NonNull @NonNull String url, @NonNull @NonNull String destination, @NonNull @NonNull eu.cloudnetservice.common.document.gson.JsonDocument properties) Constructs a new service remote inclusion instance.- Parameters:
url- the url to download the associated file from.destination- the destination inside the service directory to copy the downloaded file to.properties- the properties of the remote inclusion, these can for example contain the http headers to send.- Throws:
NullPointerException- if one of the given parameters is null.
-
-
Method Details
-
builder
Constructs a new builder instance for a service remote inclusion.- Returns:
- a new service remote inclusion builder.
-
builder
@NonNull public static @NonNull ServiceRemoteInclusion.Builder builder(@NonNull @NonNull ServiceRemoteInclusion inclusion) Constructs a new builder for a service remote inclusion which has the properties of the given inclusion already set.When calling build directly after constructing a builder using this method, it will result in a service remote inclusion which is equal but not the same as the given one.
- Parameters:
inclusion- the inclusion to copy the properties of.- Returns:
- a new service remote inclusion builder with the properties of the given one already set.
- Throws:
NullPointerException- if the given inclusion is null.
-
url
Get the url to download the remote inclusion from. The only supported schemes are http and https by default.- Returns:
- the download url of the remote inclusion.
-
destination
The target file name of the inclusion download. An inclusion destination which is outside the service directory will result in an exception.- Returns:
- the destination of the downloaded inclusion file.
-
propertyHolder
- Specified by:
propertyHolderin interfaceeu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,ServiceRemoteInclusion>
-
toString
-
clone
-