static class MakeWeb.SiteMap extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
MakeWeb.SiteMap.DBInsert
insert into tablename (name1, name2) values(exp, exp)
Suggest inserting:
entryid - id of this entry
name - text name of entry
type - 0 is file, 1 is directory, -1 is unknown
path - string path from top
parentid - id of containing directory with top = 0
length - byte length of file, 0 for directory on windows, size on linux
date - milliseconds since the epoch (00:00:00 GMT, January 1, 1970)
|
Modifier and Type | Field and Description |
---|---|
(package private) java.sql.Connection |
conn |
(package private) int |
id |
(package private) java.lang.String |
table |
(package private) java.lang.String |
topBase |
(package private) java.sql.PreparedStatement |
ustat |
Constructor and Description |
---|
SiteMap(java.sql.Connection conn,
java.lang.String table,
java.io.File top)
Insert into a database a file map of the specified
directory.
|
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
canonicalName(java.io.File f)
Gets the canonical name for a File or returns the name
"UNKNOWN"
|
static void |
main(java.lang.String... args)
arg0 = database file name
arg1 = database table name arg2 = name of top of file system can be called from command line by: java -cp makeweb.jar MakeWeb\$SiteMap test.db map . where "." can be replaced by any existing directory |
(package private) static java.lang.String |
relativePath(java.lang.String prefix,
java.lang.String absolute)
Return a relative path relative to the given absolute path.
|
(package private) void |
siteMap(java.io.File parentDir,
int parent,
MakeWeb.FileCallBack callBack)
Extend a site map for a directory - argument must be a
directory and must exist.
|
java.lang.String topBase
int id
java.sql.Connection conn
java.lang.String table
java.sql.PreparedStatement ustat
SiteMap(java.sql.Connection conn, java.lang.String table, java.io.File top)
conn
- the connection to the databasetable
- the name of the table to usetop
- the top of the file system to create a map onstatic java.lang.String canonicalName(java.io.File f)
f
- the file name to be canonizedstatic java.lang.String relativePath(java.lang.String prefix, java.lang.String absolute)
prefix
- the prefix to be stripped off of the pathabsolute
- the path to be strippedvoid siteMap(java.io.File parentDir, int parent, MakeWeb.FileCallBack callBack)
parentDir
- the current directory we are working onparent
- its unique id of the directory we are working oncallBack
- the callback object for dealing with a childpublic static void main(java.lang.String... args)
args
- command line arguments