Class SegmentPart


  • public class SegmentPart
    extends Object
    Utility class for handling information about segment parts.
    Author:
    Andrzej Bialecki
    • Field Detail

      • segmentName

        public String segmentName
        Name of the segment (just the last path component).
      • partName

        public String partName
        Name of the segment part (ie. one of subdirectories inside a segment).
    • Constructor Detail

      • SegmentPart

        public SegmentPart()
      • SegmentPart

        public SegmentPart​(String segmentName,
                           String partName)
    • Method Detail

      • toString

        public String toString()
        Return a String representation of this class, in the form "segmentName/partName".
        Overrides:
        toString in class Object
      • get

        public static SegmentPart get​(String path)
                               throws IOException
        Create SegmentPart from a full path of a location inside any segment part.
        Parameters:
        path - full path into a segment part (may include "part-xxxxx" components)
        Returns:
        SegmentPart instance describing this part.
        Throws:
        IOException - if any required path components are missing.
      • parse

        public static SegmentPart parse​(String string)
                                 throws IOException
        Create SegmentPart from a String in format "segmentName/partName".
        Parameters:
        string - input String
        Returns:
        parsed instance of SegmentPart
        Throws:
        IOException - if "/" is missing.