Class DefaultPathTranslator

  • All Implemented Interfaces:
    PathTranslator

    @Named
    @Singleton
    public class DefaultPathTranslator
    extends java.lang.Object
    implements PathTranslator
    Resolves relative paths against a specific base directory.
    Author:
    Benjamin Bentmann
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String alignToBaseDirectory​(java.lang.String path, java.io.File basedir)
      Resolves the specified path against the given base directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultPathTranslator

        public DefaultPathTranslator()
    • Method Detail

      • alignToBaseDirectory

        public java.lang.String alignToBaseDirectory​(java.lang.String path,
                                                     java.io.File basedir)
        Description copied from interface: PathTranslator
        Resolves the specified path against the given base directory. The resolved path will be absolute and uses the platform-specific file separator if a base directory is given. Otherwise, the input path will be returned unaltered.
        Specified by:
        alignToBaseDirectory in interface PathTranslator
        Parameters:
        path - The path to resolve, may be null.
        basedir - The base directory to resolve relative paths against, may be null.
        Returns:
        The resolved path or null if the input path was null.