Class RelativePathResolver_impl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.URL[] mBaseUrls
      Array of base URLs parsed from the data path.
      private java.lang.ClassLoader mClassLoader
      ClassLoader to fall back on if resource not in data path.
      private java.util.List<java.lang.String> mDataPath
      Data path as a string.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected boolean fileExistsAtUrl​(java.net.URL aUrl)  
      protected java.net.URL[] getBaseUrls()  
      java.lang.String getDataPath()
      Deprecated.
      java.util.List<java.lang.String> getDataPathElements()
      Gets the data path used to resolve relative paths.
      java.net.URL resolveRelativePath​(java.net.URL aRelativeUrl)
      Resolves a relative URL to an absolute URL.
      void setDataPath​(java.lang.String aPath)
      Deprecated.
      void setDataPathElements​(java.io.File... aPaths)
      Sets the data path elements used to resolve relative paths.
      void setDataPathElements​(java.lang.String... aPaths)
      Sets the data path elements used to resolve relative paths.
      void setPathResolverClassLoader​(java.lang.ClassLoader aClassLoader)
      Sets the ClassLoader that should be used to resolve the resources.
      • Methods inherited from class java.lang.Object

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

      • mDataPath

        private java.util.List<java.lang.String> mDataPath
        Data path as a string.
      • mBaseUrls

        private java.net.URL[] mBaseUrls
        Array of base URLs parsed from the data path.
      • mClassLoader

        private java.lang.ClassLoader mClassLoader
        ClassLoader to fall back on if resource not in data path.
    • Constructor Detail

      • RelativePathResolver_impl

        public RelativePathResolver_impl()
      • RelativePathResolver_impl

        public RelativePathResolver_impl​(java.lang.ClassLoader aClassLoader)
    • Method Detail

      • getDataPath

        @Deprecated
        public java.lang.String getDataPath()
        Deprecated.
        Description copied from interface: RelativePathResolver
        Gets the data path used to resolve relative paths. More than one directory may be specified by separating them with the System path.separator character (; on windows, : on UNIX). Elements of this path may be absolute or relative file paths.
        Specified by:
        getDataPath in interface RelativePathResolver
        Returns:
        the data path
      • getDataPathElements

        public java.util.List<java.lang.String> getDataPathElements()
        Description copied from interface: RelativePathResolver
        Gets the data path used to resolve relative paths. Elements of this path may be absolute or relative file paths.
        Specified by:
        getDataPathElements in interface RelativePathResolver
        Returns:
        the data path
      • setDataPathElements

        public void setDataPathElements​(java.io.File... aPaths)
                                 throws java.net.MalformedURLException
        Description copied from interface: RelativePathResolver
        Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative file paths.
        Specified by:
        setDataPathElements in interface RelativePathResolver
        Parameters:
        aPaths - the data path elements
        Throws:
        java.net.MalformedURLException - if a file path could not be converted to a URL
      • setDataPathElements

        public void setDataPathElements​(java.lang.String... aPaths)
                                 throws java.net.MalformedURLException
        Description copied from interface: RelativePathResolver
        Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative file paths.
        Specified by:
        setDataPathElements in interface RelativePathResolver
        Parameters:
        aPaths - the data path elements
        Throws:
        java.net.MalformedURLException - if a file path could not be converted to a URL
      • setDataPath

        @Deprecated
        public void setDataPath​(java.lang.String aPath)
                         throws java.net.MalformedURLException
        Deprecated.
        Description copied from interface: RelativePathResolver
        Sets the data path used to resolve relative paths. More than one directory may be specified by separating them with the System path.separator character (; on windows, : on UNIX). Elements of this path may be absolute or relative file paths.
        Specified by:
        setDataPath in interface RelativePathResolver
        Parameters:
        aPath - the data path
        Throws:
        java.net.MalformedURLException - if a file path could not be converted to a URL
      • resolveRelativePath

        public java.net.URL resolveRelativePath​(java.net.URL aRelativeUrl)
        Description copied from interface: RelativePathResolver
        Resolves a relative URL to an absolute URL. This will attempt to resolve the URL relative to each element of the data path, sequentially starting with the first element. If this results in an absolute URL at which a file actually exists, that absolute URL is returned. If no file could be found, null is returned.
        Specified by:
        resolveRelativePath in interface RelativePathResolver
        Parameters:
        aRelativeUrl - the relative URL to be resolved (if an absolute URL is specified, it will be returned unmodified if a file actually exists at the URL; otherwise null will be returned).
        Returns:
        the absolute URL at which the file exists, null it none could be found.
      • fileExistsAtUrl

        protected boolean fileExistsAtUrl​(java.net.URL aUrl)
      • getBaseUrls

        protected java.net.URL[] getBaseUrls()
        Returns:
        the base URLs that were parsed from the data path.