Package nva.commons.core.paths
Class UriWrapper
- java.lang.Object
-
- nva.commons.core.paths.UriWrapper
-
public class UriWrapper extends java.lang.ObjectClass for easily building and manipulating URIs. Tools to easily append paths and not have to deal with checking whether the path delimiter is present or not.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEMPTY_FRAGMENTstatic java.lang.StringEMPTY_PATH
-
Constructor Summary
Constructors Constructor Description UriWrapper(java.lang.String uri)UriWrapper(java.net.URI uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UriWrapperaddChild(java.lang.String... path)UriWrapperaddChild(UnixPath childPath)Appends a path to the URI.java.lang.StringgetFilename()UriWrappergetHost()java.util.Optional<UriWrapper>getParent()UnixPathgetPath()java.net.URIgetUri()UnixPathtoS3bucketPath()
-
-
-
Method Detail
-
getUri
public java.net.URI getUri()
-
getHost
public UriWrapper getHost()
-
addChild
public UriWrapper addChild(java.lang.String... path)
-
addChild
public UriWrapper addChild(UnixPath childPath)
Appends a path to the URI.- Parameters:
childPath- the path to be appended.- Returns:
- a UriWrapper containing the whole path.
-
toS3bucketPath
public UnixPath toS3bucketPath()
-
getPath
public UnixPath getPath()
-
getParent
public java.util.Optional<UriWrapper> getParent()
-
getFilename
public java.lang.String getFilename()
-
-