Class AbstractVFSFileProvider

    • Constructor Detail

      • AbstractVFSFileProvider

        public AbstractVFSFileProvider​(String scheme,
                                       String mountPoint,
                                       boolean canRead,
                                       boolean canWrite)
        Constructor without a current directory
        Parameters:
        scheme -
        mountPoint -
        canRead -
        canWrite -
      • AbstractVFSFileProvider

        public AbstractVFSFileProvider​(String scheme,
                                       String mountPoint,
                                       String currentDir,
                                       boolean canRead,
                                       boolean canWrite)
    • Method Detail

      • setScheme

        public void setScheme​(String scheme)
        Description copied from interface: VFSFileProvider
        The scheme is does not end with the scheme delimiter and should be normalized here.
        Specified by:
        setScheme in interface VFSFileProvider
      • setMountPoint

        public void setMountPoint​(String mountPoint)
        Description copied from interface: VFSFileProvider
        The mount point does both start and end with the path separator since we always need it. The mount point should be normalized in the setter.
        Specified by:
        setMountPoint in interface VFSFileProvider
      • checkPath

        protected void checkPath​(String path)
      • isScript

        public boolean isScript​(String name)
        Description copied from interface: VFSFileProvider
        Checks if the FQ name can be resolved to a script by this provider.
        Specified by:
        isScript in interface VFSFileProvider
        Returns:
      • isAbsolute

        public static boolean isAbsolute​(String path)
        Returns if this path is absolute, i.e. if it starts with the path separator. So A#/a/b/c is absolute, A#b/c is not.

        An absolute path contains enough information to find the file. A relative path does not. This will compare them ignoring schemes.
        Parameters:
        path -
        Returns:
      • getRealPath

        protected String getRealPath​(String path)
        Resolves this against any current directory and returns the unqualified *relative* path against the store's root path.
        Parameters:
        path -
        Returns:
      • unqualifyPath

        protected String unqualifyPath​(String x)
      • getStoreRoot

        public String getStoreRoot()
        The root fo this store. So if the scheme is A and the mount point is /a/b/c then this returns A#/a/b/c. Operations on the store typiclly use this for resolving paths.
        Returns:
      • isChildOf

        protected boolean isChildOf​(String[] top,
                                    String target,
                                    boolean isRoot)
        Use this for stores that keep everything in a flat list (like a database table or hash map of file paths.) You use VFSPaths.toPathComponents(String) on the argument to the dir(String)command and specify if it is the root node (since figuring that out is store dependent). This then compares paths by lengths to give back the right one.
        Parameters:
        top -
        target -
        isRoot -
        Returns:
      • mkdir

        public boolean mkdir​(String path)
        Description copied from interface: VFSFileProvider
        Make a set of directories. This will make a given directory and any intermediate directories.
        Specified by:
        mkdir in interface VFSFileProvider
        Returns: