Class ArchPaths

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class ArchPaths
    extends Object
    implements Closeable
    This is a replacement for NIO Paths that caters to our syntax rules. Normal file system paths are all similar to linux file names. The compressed use the jar:file:syntax. For example, jar:file:///ziptest/alltext.zip!/SomeTextFile.txt
    Author:
    luofeng, mshankar
    • Constructor Detail

      • ArchPaths

        public ArchPaths()
    • Method Detail

      • get

        public Path get​(String first,
                        String... more)
                 throws IOException
        Return a path based on a varargs list of path components. Each path component is separated by the file separator.
        Parameters:
        first -  
        more -  
        Returns:
        Path  
        Throws:
        IOException -  
      • get

        public Path get​(boolean createParent,
                        String first,
                        String... more)
                 throws IOException
        Return a path based on a varargs list of path components. Each path component is separated by the file separator.
        Parameters:
        createParent - If this is true, we create the parent automatically when requesting the path
        first -  
        more -  
        Returns:
        Path  
        Throws:
        IOException -  
      • get

        public Path get​(String uriPathOrDefautFilePath)
                 throws IOException
        Parameters:
        uriPathOrDefautFilePath -  
        Returns:
        Path  
        Throws:
        IOException -  
      • get

        public Path get​(String uriPathOrDefautFilePath,
                        boolean createParent)
                 throws IOException
        Return a path based on the full URI representation of the path.
        Parameters:
        uriPathOrDefautFilePath -  
        createParent - If this is true, we create the parent automatically when requesting the path
        Returns:
        Path  
        Throws:
        IOException -  
      • newByteChannel

        public static SeekableByteChannel newByteChannel​(Path path,
                                                         OpenOption... options)
                                                  throws IOException
        Returns a seekable byte channel. In case of file systems, this is the raw SeekableByteChannel as returned by the provider. In case of zip files, we wrap the InputStream using WrappedSeekableByteChannel (which is a read only byte channel for now).
        Parameters:
        path - Path
        options - OpenOption
        Returns:
        a new seekabel byte channel
        Throws:
        IOException -  
      • getPathForBackup

        public String getPathForBackup​(Path path)
                                throws IOException
        The path used for backing up the data using ETL. When enabling compression with packing, we backup the packed file itself as opposed to the files within the packed file.
        Parameters:
        path - Path
        Returns:
        Path for backup
        Throws:
        IOException -