class Catalog extends AnyRef

The information maintained by crawling all the locations

Source
catalog.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Catalog
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Catalog(locationsParam: HashSet[String] = HashSet(), inclusionsParam: HashSet[String] = HashSet("*.elf"), exclusionsParam: HashSet[String] = HashSet(".svn"), port: Int = 8080, searchPort: Boolean = false, log: (String) ⇒ Unit = println, crawlingInterval: Int = 30, deletingInterval: Int = 17)

    locationsParam

    set of disk locations to scan, given as strings

    inclusionsParam

    set of inclusion patterns, given as strings. Default value is *.elf

    exclusionsParam

    set of exclusion patterns, given as strings. Default value is .svn

    port

    port on which the server runs. Default value is 8080

    searchPort

    specifies whether the catalog should search for available ports incrementally if the specified port is not available

    log

    : String => Unit the function used for logging. Default is a function that logs to stdout

    crawlingInterval

    interval, in seconds, between two automatic crawls. Default value is 30 sec

    deletingInterval

    interval, in seconds, between two automatic deletions (from hashes) of files that no longer exist on disk. Default value is 17 sec

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addExclusion(pattern: String): Unit

    Add an exclusion pattern to the storage

  5. def addInclusion(pattern: String): Unit

    Add an inclusion pattern to the storage

  6. def addStringLocation(locationName: String): Unit

    Add a location by its string address.

    Add a location by its string address. If the location is a descendant of an already watched folder, it is not added. If the location is an ancestor of an already watched location, then it is added and the already watched location is removed.

    locationName

    the (absolute or relative) address of the location on disk

    Exceptions thrown

    InexistentLocation if the file/folder does not exist or cannot be read

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  9. def crawl(location: File): Unit

    Crawl through a specific file or folder

    Crawl through a specific file or folder

    location

    the file or folder descriptor

  10. def crawlAll: Unit

    Crawl through all stored locations, ignoring (but logging) errors

  11. val crawlingInterval: Int
  12. def deleteStringLocation(locationName: String): Unit

    Delete from watch list a location given by its string address.

    Delete from watch list a location given by its string address.

    locationName

    the (absolute or relative) address of the location on disk

    Exceptions thrown

    InexistentLocation if the location is not in the watch list

  13. val deletingInterval: Int
  14. def destroy: Unit

    Stop the web server

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. val exclusionsParam: HashSet[String]
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def getChildren(stringUri: String): Array[String]

    Get all children of a namespace URI, module, constant or structure

    Get all children of a namespace URI, module, constant or structure

    stringUri

    URI of a module / constant / structure, given as a string

    returns

    an array of children URIs, given as strings

    Exceptions thrown

    CatalogError(s: String) if the URI is unknown

    java.net.URISyntaxException if the URI is not valid

  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def getDependencies(stringUri: String): Array[String]

    Get all dependencies of a module, constant or structure

    Get all dependencies of a module, constant or structure

    stringUri

    URI of a module / constant / structure, given as a string

    returns

    an array of dependency URIs, given as strings

    Exceptions thrown

    CatalogError(s: String) if the URI is unknown

    java.net.URISyntaxException if the URI is not valid

  22. def getExclusions: HashSet[String]

    Exclusion patterns for files and folders.

    Exclusion patterns for files and folders. Star is the only special character and matches any sequence of characters. A folder is crawled iff it doesn't match any exclusion pattern. A file is crawled iff it matches at least one inclusion pattern, but no exclusion pattern. However, if no inclusion patterns are provided, only the second condition remains.

  23. def getInclusions: HashSet[String]

    Inclusion patterns for files Star is the only special character and matches any sequence of characters.

    Inclusion patterns for files Star is the only special character and matches any sequence of characters. A folder is crawled iff it doesn't match any exclusion pattern. A file is crawled iff it matches at least one inclusion pattern, but no exclusion pattern. However, if no inclusion patterns are provided, only the second condition remains.

  24. def getMeta(stringUri: String, asText: Boolean = false): String

    Get the semantic comment associated with a document, module, constant or structure

    Get the semantic comment associated with a document, module, constant or structure

    stringUri

    URI of a module or URL of a document, given as string

    asText

    set it to true for text output and to false for XML output

    returns

    if asText is true, the semantic comment, copied character by character from the file. Otherwise, an XML representation of the comment

    Exceptions thrown

    CatalogError(s: String) if the URI/URL is unknown

    java.net.URISyntaxException if stringUri does not point to a location on disk and, as a URI, it is not valid

  25. def getModulesInNamespace(stringUri: String): Array[String]

    Get the modules introduced by a namespace, in alphabetical order

    Get the modules introduced by a namespace, in alphabetical order

    stringUri

    a namespace URI, given as a string

    returns

    an URL encoding the file and the position within that file

    Exceptions thrown

    CatalogError(s: String) if the namespace URI is unknown

    java.net.URISyntaxException if the URI is not valid

  26. def getNamespaces(): Array[String]

    Get the list of namespaces declared in all the files in all the maintained locations

    Get the list of namespaces declared in all the files in all the maintained locations

    returns

    an array of namespace URIs given as strings

  27. def getNamespaces(stringUrl: String): Array[String]

    Get all namespaces URIs introduced by a document

    Get all namespaces URIs introduced by a document

    stringUrl

    URL (location on disk) of a document, given as a string

    returns

    an array of namespace URIs given as strings

    Exceptions thrown

    CatalogError(s: String) if the URL is unknown

  28. def getOmdoc(stringUrl: String): String

    Get a document skeleton as Omdoc

    Get a document skeleton as Omdoc

    stringUrl

    URL (location on disk) of a document, given as a string

    returns

    the document as Omdoc

    Exceptions thrown

    CatalogError(s: String) if the URL is unknown

  29. def getPosition(stringUri: String): String

    Get the position of a module, constant or structure.

    Get the position of a module, constant or structure.

    stringUri

    URI of a module / constant / structure, given as a string

    returns

    an URL encoding the file and the position within that file

    Exceptions thrown

    CatalogError(s: String) if the URI is unknown

    java.net.URISyntaxException if the URI is not valid

  30. def getText(stringUri: String): String

    Get the text of an entity.

    Get the text of an entity. The HTTP header also has a field X-Source-url, followed by the position of the entity as returned by getPosition Warning: this function reads the disk, since the text is not stored in memory.

    stringUri

    URI of a module or URL of a document, given as string

    returns

    the actual content, read from the file

    Exceptions thrown

    CatalogError(s: String) if the URI/URL is unknown

    FileOpenError(s) if the file cannot be read

    java.net.URISyntaxException if stringUri does not point to a location on disk which is also stored in memory and, as a URI, it is not valid

  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. val inclusionsParam: HashSet[String]
  33. def init: Int

    Start the web server, background threads, add given patterns & locations

    Start the web server, background threads, add given patterns & locations

    returns

    the port number, which can be different from the port specified in the constructor

    Exceptions thrown

    PortUnavailable if the web server cannot be started because the specified port is already in use

  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. val locations: HashSet[File]

    Locations (files and folders) being watched

  36. val locationsParam: HashSet[String]
  37. val log: (String) ⇒ Unit
  38. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. var port: Int
  42. def queryURI: String

    The URI for querying the catalog with getText

  43. val searchPort: Boolean
  44. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. def uncrawl(url: String): Unit

    Delete all the hash entries associated with a specific file or folder

  47. def uncrawlAll: Unit

    Clear the storage

  48. val uriToModulesDeclared: HashMap[URI, LinkedHashSet[URI]]

    Map from namespace URIs to modules declared in that URI

  49. val uriToNamedBlock: HashMap[URI, NamedBlock]

    Map from URIs to named blocks (modules, declarations or assignments)

  50. val urlToDocument: HashMap[URI, Document]

    Map from URLs to documents.

    Map from URLs to documents. Its key set is the set of file URLs that are currently indexed

  51. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  54. def writeOmdocToFile(stringUrl: String): Unit

    Write the Omdoc skeleton to a file with the same name as the original and in the same folder, but with extension .omdocsk

    Write the Omdoc skeleton to a file with the same name as the original and in the same folder, but with extension .omdocsk

    stringUrl

    the URL of the .elf file to be converted.

    Exceptions thrown

    CatalogError(s) if the URL is not OK or not crawled already

Inherited from AnyRef

Inherited from Any

Ungrouped