Record Class NestedLocation
java.lang.Object
java.lang.Record
org.springframework.boot.loader.net.protocol.nested.NestedLocation
- Record Components:
path
- the path to the zip that contains the nested entrynestedEntryName
- the nested entry name
A location obtained from a
nested:
URL
consisting of a jar file and an
optional nested entry.
The syntax of a nested JAR URL is:
nestedjar:<path>/!{entry}
for example:
nested:/home/example/my.jar/!BOOT-INF/lib/my-nested.jar
or:
nested:/home/example/my.jar/!BOOT-INF/classes/
The path must refer to a jar file on the file system. The entry refers to either an
uncompressed entry that contains the nested jar, or a directory entry. The entry must
not start with a '/'
.
- Since:
- 3.2.0
- Author:
- Phillip Webb, Andy Wilkinson
-
Constructor Summary
ConstructorDescriptionNestedLocation
(Path path, String nestedEntryName) Creates an instance of aNestedLocation
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static NestedLocation
Create a newNestedLocation
from the given URI.static NestedLocation
Create a newNestedLocation
from the given URL.final int
hashCode()
Returns a hash code value for this object.Returns the value of thenestedEntryName
record component.path()
Returns the value of thepath
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
NestedLocation
Creates an instance of aNestedLocation
record class.- Parameters:
path
- the value for thepath
record componentnestedEntryName
- the value for thenestedEntryName
record component
-
-
Method Details
-
fromUrl
Create a newNestedLocation
from the given URL.- Parameters:
url
- the nested URL- Returns:
- a new
NestedLocation
instance - Throws:
IllegalArgumentException
- if the URL is not valid
-
fromUri
Create a newNestedLocation
from the given URI.- Parameters:
uri
- the nested URI- Returns:
- a new
NestedLocation
instance - Throws:
IllegalArgumentException
- if the URI is not valid
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
path
Returns the value of thepath
record component.- Returns:
- the value of the
path
record component
-
nestedEntryName
Returns the value of thenestedEntryName
record component.- Returns:
- the value of the
nestedEntryName
record component
-