Class SimplePathBuilder

  • All Implemented Interfaces:
    PathBuilder

    public class SimplePathBuilder
    extends Object
    implements PathBuilder
    Simple implementation of a tool that permits to convert filenames from absolute to relative and the opposite..
    Since:
    15.0
    Version:
    17.0 2020-01-04 14:41:40
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    inputoutput
    • Constructor Detail

      • SimplePathBuilder

        public SimplePathBuilder()
        Constructor.
      • SimplePathBuilder

        public SimplePathBuilder​(String currentDirectory)
        Constructor with current directory.
        Parameters:
        currentDirectory - is the default/current directory used to make absolute the reltive paths.
      • SimplePathBuilder

        public SimplePathBuilder​(File currentDirectory)
        Constructor with current directory.
        Parameters:
        currentDirectory - is the default/current directory used to make absolute the reltive paths.
      • SimplePathBuilder

        public SimplePathBuilder​(URL currentDirectory)
        Constructor with current directory.
        Parameters:
        currentDirectory - is the default/current directory used to make absolute the reltive paths.
    • Method Detail

      • setCurrentDirectory

        public void setCurrentDirectory​(String currentDirectory)
        Description copied from interface: PathBuilder
        Set the default/current directory used to make absolute the reltive paths.

        This function tries to build an URL, and if it fails it assumed that the given string is a filename to pass to File.

        Specified by:
        setCurrentDirectory in interface PathBuilder
        Parameters:
        currentDirectory - is the default/current directory used to make absolute the reltive paths.
      • setCurrentDirectory

        public void setCurrentDirectory​(File currentDirectory)
        Description copied from interface: PathBuilder
        Set the default/current directory used to make absolute the reltive paths.
        Specified by:
        setCurrentDirectory in interface PathBuilder
        Parameters:
        currentDirectory - is the default/current directory used to make absolute the reltive paths.
      • setCurrentDirectory

        public void setCurrentDirectory​(URL currentDirectory)
        Description copied from interface: PathBuilder
        Set the default/current directory used to make absolute the reltive paths.
        Specified by:
        setCurrentDirectory in interface PathBuilder
        Parameters:
        currentDirectory - is the default/current directory used to make absolute the reltive paths.
      • getCurrentDirectoryFile

        public File getCurrentDirectoryFile()
        Description copied from interface: PathBuilder
        Replies the default/current directory used to make absolute the reltive paths.

        If the current directory is a File, it is replied. If the current directory is an URL with "file" protocol, its path is replied. In all other cases the user home directory is replied, or the default directory if the user home is unavailable.

        Specified by:
        getCurrentDirectoryFile in interface PathBuilder
        Returns:
        the default/current directory used to make absolute the reltive paths.
        See Also:
        PathBuilder.getCurrentDirectoryString(), PathBuilder.getCurrentDirectoryURL()