|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.basex.build.Parser
org.basex.build.fs.FSParser
public final class FSParser
Imports/shreds/parses a file hierarchy into a BaseX database. The overall process of importing a file hierarchy can be described as follows:
Create command and its
Create fs() function. To import on the command line type:
$ create fs [dbname] [path]
FSParser instantiates the needed components
for the import process in its parse(Builder) method.
The components are:
FSWalker,
FSVisitor| Field Summary |
|---|
| Fields inherited from class org.basex.build.Parser |
|---|
file |
| Constructor Summary | |
|---|---|
FSParser(java.lang.String path)
Constructor. |
|
| Method Summary | |
|---|---|
void |
parse(Builder build)
Main entry point for the import of a file hierarchy to BaseX. |
double |
percent()
Returns a value from 0 to 1, representing the current progress. |
void |
postEvent()
Invoked when directory is left. |
void |
postTraversal(boolean docClose)
Invoked after the traversal. |
void |
preEvent(java.io.File dir)
Invoked before directory is entered. |
void |
preTraversal(java.lang.String path,
boolean docOpen)
Invoked before traversal starts. |
void |
regfileEvent(java.io.File f)
Invoked when a regular file is visited. |
void |
symlinkEvent(java.io.File link)
Invoked when a symbolic link is visited. |
java.lang.String |
title()
Returns a compact description of the current progress. |
java.lang.String |
toString()
Returns detailed progress information. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FSParser(java.lang.String path)
path - the traversal starts from (enter "/" or leave empty to parse
all partitions (C:, D: ...) on Windows)| Method Detail |
|---|
public void parse(Builder build)
throws java.io.IOException
parse in class Parserbuild - instance passed by Create fs().
java.io.IOException - I/O exceptionpublic double percent()
Parser
percent in class Parser
public void postEvent()
throws java.io.IOException
postEvent in interface FSVisitorjava.io.IOException - I/O exception
public void postTraversal(boolean docClose)
throws java.io.IOException
postTraversal in interface FSVisitordocClose - indicates if the document is to be closed.
java.io.IOException - I/O exception
public void preEvent(java.io.File dir)
throws java.io.IOException
preEvent in interface FSVisitordir - name
java.io.IOException - I/O exception
public void preTraversal(java.lang.String path,
boolean docOpen)
throws java.io.IOException
preTraversal in interface FSVisitorpath - the traversal starts from.docOpen - indicates if this is also the beginning of the document.
java.io.IOException - I/O exception
public void regfileEvent(java.io.File f)
throws java.io.IOException
regfileEvent in interface FSVisitorf - name
java.io.IOException - I/O exceptionpublic void symlinkEvent(java.io.File link)
symlinkEvent in interface FSVisitorlink - to be visited.public java.lang.String title()
Parser
title in class Parserpublic java.lang.String toString()
Parser
toString in class Parser
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||