Class DirectoryScanner


  • public class DirectoryScanner
    extends Object
    Allow generation of THREDDS InvCatalog documents from the contents of a local directory.
    Since:
    2004-12-10T15:33:32-0700
    • Constructor Detail

      • DirectoryScanner

        public DirectoryScanner​(InvService service,
                                String serviceTitle,
                                File serviceBaseUrlDir,
                                String prefixPath,
                                boolean createCatalogRefs)
        Construct a DirectoryScanner given information about the data server to be cataloged.
        Parameters:
        service - - the service for the datasets found in the directory scanned.
        serviceTitle - - a title for the service (used as the title of the top-level dataset).
        serviceBaseUrlDir - - the local directory to which the service's base URL references.
        prefixPath - - path name to append to the urlPath of resulting datasets, can be null.
        createCatalogRefs - - if true, generate a catalogRef for each directory, otherwise, recurse into directories.
        Throws:
        IllegalArgumentException - if invalid service type is given or root directory is not a directory.
    • Method Detail

      • getDirCatalog

        public InvCatalog getDirCatalog​(File directory,
                                        String filterPattern,
                                        boolean sortInIncreasingOrder,
                                        boolean addDatasetSize)
        Return a catalog for the given directory.
        Parameters:
        directory - - the directory to represent as a catalog.
        filterPattern -
        sortInIncreasingOrder -
        Returns:
        An InvCatalog that represents the given directory of datasets.
        Throws:
        NullPointerException - if the given directory is null.
        IllegalArgumentException - if the given directory is not actually a directory or if it is not under the service base URL directory.
      • getDirCatalog

        public InvCatalog getDirCatalog​(File directory,
                                        String filterPattern,
                                        boolean sortInIncreasingOrder,
                                        String addIdBase,
                                        boolean addDatasetSize,
                                        String dsNameMatchPattern,
                                        String startTimeSubstitutionPattern,
                                        String duration)