Class AbstractPortalBaseFolder

  • All Implemented Interfaces:
    java.io.Serializable, IPortalBaseFolder

    public abstract class AbstractPortalBaseFolder
    extends java.lang.Object
    implements IPortalBaseFolder
    Abstract IPortalBaseFolder implementation, used as base class for some implementations.

    This implementation assumes the base folder corresponds to a folder in the local file system. The concrete implementation decides the local folder to be used by implementing calculateBasePath().

    Since:
    6.2.0
    Version:
    $Revision: 22420 $ $Date: 2019-02-19 16:21:02 -0300 (Tue, 19 Feb 2019) $
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.lang.String calculateBasePath()
      Calculates the absolute path for this base folder.
      java.lang.String getAbsolutePath​(java.lang.String relativePath)
      Calculates the absolute path from a relative path to this base folder.
      java.lang.String getBasePath()
      Returns the path that corresponds to this base folder.
      java.lang.String getRelativePath​(java.lang.String absolutePath)
      Calculates the relative path to this base folder for the given absolute path.
      java.lang.String toString()
      A string for display purposes that identifies this base folder.
      • Methods inherited from class java.lang.Object

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

      • AbstractPortalBaseFolder

        public AbstractPortalBaseFolder()
    • Method Detail

      • getBasePath

        public final java.lang.String getBasePath()
        Returns the path that corresponds to this base folder.
        Returns:
        the file system path to be used as reference to this web root base folder.
        Since:
        6.2.0
      • calculateBasePath

        protected abstract java.lang.String calculateBasePath()
        Calculates the absolute path for this base folder.

        Called by getBasePath(). Its result stored and reused automatically.

        Returns:
        the absolute path for this base folder.
        Since:
        6.2.0
      • getAbsolutePath

        public java.lang.String getAbsolutePath​(java.lang.String relativePath)
        Description copied from interface: IPortalBaseFolder
        Calculates the absolute path from a relative path to this base folder.
        Specified by:
        getAbsolutePath in interface IPortalBaseFolder
        Parameters:
        relativePath - the relative path.
        Returns:
        the absolute path.
      • getRelativePath

        public java.lang.String getRelativePath​(java.lang.String absolutePath)
        Description copied from interface: IPortalBaseFolder
        Calculates the relative path to this base folder for the given absolute path.
        Specified by:
        getRelativePath in interface IPortalBaseFolder
        Parameters:
        absolutePath - the absolute path.
        Returns:
        the calculated relative path, relative to this base folder.
      • toString

        public java.lang.String toString()
        Description copied from interface: IPortalBaseFolder
        A string for display purposes that identifies this base folder.

        In special, PortalFilePath uses this string to create its own toString, in the form: [base folder]:/[relative path]. This method should return a value that keeps that form friendly.

        Specified by:
        toString in interface IPortalBaseFolder
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this base folder.