Package picard.nio

Class PicardHtsPath

  • All Implemented Interfaces:
    htsjdk.io.IOPath, Serializable

    public class PicardHtsPath
    extends htsjdk.io.HtsPath
    A Subclass of HtsPath with conversion to Path making use of IOUtil
    See Also:
    Serialized Form
    • Constructor Detail

      • PicardHtsPath

        public PicardHtsPath​(String rawInputString)
        Create a PicardHtsPath from a raw input path string.

        If the raw input string already contains a scheme (including a "file" scheme), assume its already properly escape/encoded. If no scheme component is present, assume it references a raw path on the local file system, so try to get a Path first, and then retrieve the URI from the resulting Path. This ensures that input strings that are local file references without a scheme component and contain embedded characters are valid in file names, but which would otherwise be interpreted as excluded URI characters (such as the URI fragment delimiter "#") are properly escape/encoded.

        Parameters:
        rawInputString - a string specifying an input path. May not be null.
      • PicardHtsPath

        public PicardHtsPath​(htsjdk.io.HtsPath htsPath)
        Create a PicardHtsPath from an existing HtsPath or subclass.
        Parameters:
        htsPath - an existing PathSpecifier. May not be null.
      • PicardHtsPath

        public PicardHtsPath​(File file)
        Create a PicardHtsPath from a File reference. Uses the URI string of file.
        Parameters:
        file - the file reference to create this object from
    • Method Detail

      • fromPaths

        public static List<PicardHtsPath> fromPaths​(Collection<String> paths)
        Create a List from path representations.
        Parameters:
        paths - URIs or local paths. May not be null but may be empty.
        Returns:
        the converted List
      • toPath

        public Path toPath()
        Resolve the URI of this object to a Path object.
        Specified by:
        toPath in interface htsjdk.io.IOPath
        Overrides:
        toPath in class htsjdk.io.HtsPath
        Returns:
        the resulting Path
        Throws:
        RuntimeException - if an I/O error occurs when creating the file system
      • fromPath

        public static PicardHtsPath fromPath​(Path path)
        Construct a PicardHtsPath from a Path
        Parameters:
        path - may NOT be null
        Returns:
        a new object representing path