Package org.apache.hc.core5.net
Class PathSegmentCodec
- java.lang.Object
-
- org.apache.hc.core5.net.PathSegmentCodec
-
public class PathSegmentCodec extends java.lang.ObjectURI path segment codec.- Since:
- 5.5
-
-
Constructor Summary
Constructors Constructor Description PathSegmentCodec()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringformatSegments(java.lang.Iterable<java.lang.String> segments, java.nio.charset.Charset charset)Returns a string consisting of joint encoded path segments.static java.lang.StringformatSegments(java.lang.String... segments)Returns a string consisting of joint encoded path segments.static voidformatSegments(java.lang.StringBuilder buf, java.lang.Iterable<java.lang.String> segments, java.nio.charset.Charset charset)Copies encoded path segments into the given content buffer.static java.util.List<java.lang.String>optimizePathSegments(java.util.List<java.lang.String> segments)Optimizes path segments.static java.util.List<java.lang.String>parsePathSegments(java.lang.CharSequence s)Returns a list of URI path segments.static java.util.List<java.lang.String>parsePathSegments(java.lang.CharSequence s, java.nio.charset.Charset charset)Returns a list of URI path segments.static java.util.List<java.lang.String>splitPath(java.lang.CharSequence s)Splits URI path into a list of segments without decoding the segments.
-
-
-
Method Detail
-
splitPath
public static java.util.List<java.lang.String> splitPath(java.lang.CharSequence s)
Splits URI path into a list of segments without decoding the segments.- Parameters:
s- URI path component.- Returns:
- list of segments.
-
parsePathSegments
public static java.util.List<java.lang.String> parsePathSegments(java.lang.CharSequence s, java.nio.charset.Charset charset)Returns a list of URI path segments.- Parameters:
s- URI path component.charset- parameter charset.- Returns:
- list of segments.
-
parsePathSegments
public static java.util.List<java.lang.String> parsePathSegments(java.lang.CharSequence s)
Returns a list of URI path segments.- Parameters:
s- URI path component.- Returns:
- list of segments.
-
optimizePathSegments
public static java.util.List<java.lang.String> optimizePathSegments(java.util.List<java.lang.String> segments)
Optimizes path segments.- Returns:
- list of optimized segments
-
formatSegments
public static java.lang.String formatSegments(java.lang.Iterable<java.lang.String> segments, java.nio.charset.Charset charset)Returns a string consisting of joint encoded path segments.- Parameters:
segments- the segments.charset- parameter charset.- Returns:
- URI path component
-
formatSegments
public static void formatSegments(java.lang.StringBuilder buf, java.lang.Iterable<java.lang.String> segments, java.nio.charset.Charset charset)Copies encoded path segments into the given content buffer.- Parameters:
buf- content buffer.segments- the segments.charset- parameter charset.
-
formatSegments
public static java.lang.String formatSegments(java.lang.String... segments)
Returns a string consisting of joint encoded path segments.- Parameters:
segments- the segments.- Returns:
- URI path component
-
-