Class CrawlableDatasetFactory


  • public class CrawlableDatasetFactory
    extends Object
    A description
    Since:
    Jun 23, 2005T10:29:26 PM
    • Constructor Detail

      • CrawlableDatasetFactory

        public CrawlableDatasetFactory()
    • Method Detail

      • createCrawlableDataset

        public static CrawlableDataset createCrawlableDataset​(String path,
                                                              String className,
                                                              Object configObj)
                                                       throws IOException,
                                                              ClassNotFoundException,
                                                              NoSuchMethodException,
                                                              IllegalAccessException,
                                                              InvocationTargetException,
                                                              InstantiationException,
                                                              IllegalArgumentException,
                                                              NullPointerException
        Construct a CrawlableDataset for the given path using the CrawlableDataset implementation indicated by the given class name. The class given by className is used to instantiate the requested CrawlableDataset and so must be an implementation of thredds.crawlabledataset.CrawlableDataset. The given class must also supply a public constructor with a single String argument. The String argument is the path for the CrawlableDataset being constructed. If className is null, thredds.crawlabledataset.CrawlableDatasetFile will be used. If the path is an alias containing wildcard characters ("*"), the class thredds.crawlabledataset.CrawlableDatasetAlias will be used to expand the alias into a collection of CrawlableDatasets of the type given by className.
        Parameters:
        path - the path of the CrawlableDataset.
        className - the class name of the CrawlableDataset implementation to instantiate.
        configObj -
        Returns:
        a CrawlableDataset for the given path and of the type given by the class name.
        Throws:
        IOException - if a CrawlableDataset cannot be created due to IO problems.
        ClassNotFoundException - if the given CrawlableDataset implementation was not found.
        NoSuchMethodException - if the given CrawlableDataset implementation does not have a constructor with a single String parameter which is required.
        IllegalAccessException - if the constructor is inaccessible due to Java language access control.
        InvocationTargetException - if the constructor throws an exception.
        InstantiationException - if the given CrawlableDataset implementation is an abstract class.
        NullPointerException - if the given path is null.
        IllegalArgumentException - if the given class name is not an implementation of CrawlableDataset.
      • normalizePath

        public static String normalizePath​(String path)
        Normalize the given path so that it can be used in the creation of a CrawlableDataset. This method can be used on absolute or relative paths. Normal uses slashes ("/") as path seperator, not backslashes ("\"), and does not use trailing slashes. This function allows users to specify Windows pathnames and UNC pathnames in there normal manner.
        Parameters:
        path - the path to be normalized.
        Returns:
        the normalized path.
        Throws:
        NullPointerException - if path is null.