Class ArchPaths

java.lang.Object
org.epics.archiverappliance.utils.nio.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
  • Field Details

  • Constructor Details

    • ArchPaths

      public ArchPaths()
  • Method Details

    • 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 -  
    • 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 -  
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException