class Catalog extends AnyRef
- Alphabetic
- By Inheritance
- Catalog
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addExclusion(pattern: String): Unit
Add an exclusion pattern to the storage
-
def
addInclusion(pattern: String): Unit
Add an inclusion pattern to the storage
-
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
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
-
def
crawlAll: Unit
Crawl through all stored locations, ignoring (but logging) errors
- val crawlingInterval: Int
-
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
- val deletingInterval: Int
-
def
destroy: Unit
Stop the web server
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val exclusionsParam: HashSet[String]
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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 unknownjava.net.URISyntaxException
if the URI is not valid
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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 unknownjava.net.URISyntaxException
if the URI is not valid
-
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.
-
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.
-
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 unknownjava.net.URISyntaxException
if stringUri does not point to a location on disk and, as a URI, it is not valid
-
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 unknownjava.net.URISyntaxException
if the URI is not valid
-
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
-
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
-
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
-
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 unknownjava.net.URISyntaxException
if the URI is not valid
-
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 unknownFileOpenError(s)
if the file cannot be readjava.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
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val inclusionsParam: HashSet[String]
-
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
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
locations: HashSet[File]
Locations (files and folders) being watched
- val locationsParam: HashSet[String]
- val log: (String) ⇒ Unit
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- var port: Int
-
def
queryURI: String
The URI for querying the catalog with getText
- val searchPort: Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
uncrawl(url: String): Unit
Delete all the hash entries associated with a specific file or folder
-
def
uncrawlAll: Unit
Clear the storage
-
val
uriToModulesDeclared: HashMap[URI, LinkedHashSet[URI]]
Map from namespace URIs to modules declared in that URI
-
val
uriToNamedBlock: HashMap[URI, NamedBlock]
Map from URIs to named blocks (modules, declarations or assignments)
-
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
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
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