|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kom.gateway.DBLow
Low level database handling
Field Summary | |
static java.lang.String |
absCDBpath
Absolute path to the CDB directory |
(package private) static ServerConfig |
config
Server configuration data |
(package private) static char |
fSep
|
(package private) static java.lang.String |
fSeparator
File path separator, e g "/" in Unix, "\" in Windows |
(package private) static java.util.Hashtable |
msgAuth
Table of authorization data for terminal URLs |
(package private) static java.util.Hashtable |
msgParts
Cache of message parts (such as images) |
Constructor Summary | |
(package private) |
DBLow(ServerConfig config)
Class constructor |
Method Summary | |
private boolean |
accessPart(java.lang.String p,
java.lang.String sid)
Checks if access to a component is allowed |
(package private) void |
addFile(java.lang.String path,
java.io.InputStream is,
boolean apnd)
Adds data to the file database. |
(package private) boolean |
areaExists(java.lang.String area)
Check if user area exists already |
(package private) java.lang.String |
basedRef(java.lang.String ref)
Returns a reference starting with current servletBase. |
(package private) void |
createArea(java.lang.String path)
Creates object area (directory). |
(package private) void |
debugLog(java.lang.String s)
|
(package private) void |
errorLog(java.lang.String s)
|
protected boolean |
expungeFile(java.io.File f)
Deletes a file. |
private java.io.InputStream |
File2Stream(java.io.File f)
Makes an InputStream from a File |
(package private) java.lang.String |
File2String(java.io.File f)
Gets contents of a File |
(package private) boolean |
findPart(java.lang.String path,
java.lang.String sid)
Looks up a part in msgParts or as a file |
protected java.io.File |
getFile(java.lang.String fRef)
Defines (file) path corresponding to an object |
(package private) java.lang.String |
getFileContents(java.lang.String url)
Gets contents of a file |
(package private) java.io.InputStream |
getFileStream(java.lang.String path)
Finds data in the file database |
(package private) java.lang.String |
getPath(java.lang.String fRef)
Defines path corresponding to an object. |
(package private) java.io.InputStream |
getStandard(java.lang.String url)
Gets contents (of a file) corresponding to an url. |
(package private) boolean |
isMailSpool(java.lang.String path)
Returns true if file path indicates a mail spool file. |
long |
lastModified(java.lang.String url)
Gets time of last modification of object |
long |
length(java.lang.String url)
Gets size of object |
(package private) java.lang.String[] |
listFiles(java.lang.String path,
java.lang.String pfx)
Gets a list of file names from a directory |
(package private) void |
makePart(java.lang.String rId,
java.lang.String part,
java.io.InputStream b)
Makes a body part (attachment) file |
(package private) java.io.InputStream |
msgPartStream(java.lang.String rId,
java.lang.String partName,
java.io.File msgfile,
java.lang.String sid)
Creates an InputStream for a message part |
(package private) java.io.File |
partfile(java.lang.String url,
java.lang.String part,
boolean full)
Creates a File object |
(package private) java.lang.String |
partpath(java.lang.String url,
java.lang.String part,
boolean full)
Determines path of part file. |
(package private) void |
printStackTrace(java.lang.Throwable x,
java.lang.String debugmessage)
|
(package private) java.lang.Object |
readObject(java.lang.String name)
Reads an object from a file |
(package private) boolean |
removeFile(java.lang.String path)
Deletes a file in the database |
(package private) void |
replaceMime(java.lang.String path,
java.lang.String repl)
Replaces a file |
(package private) java.lang.String |
updseq1(java.lang.String path,
boolean update,
java.lang.String value)
Updates or just gets a sequence number |
private void |
validate(java.lang.String p,
java.lang.String sid)
Registers sid as a valid key to p |
protected void |
validate(java.lang.String id,
java.lang.String part,
java.lang.String sid)
|
(package private) void |
writeObject(java.lang.String name,
java.lang.Object obj)
Writes an object |
Methods inherited from class java.lang.Object |
|
Field Detail |
static ServerConfig config
static java.lang.String fSeparator
static char fSep
public static java.lang.String absCDBpath
static java.util.Hashtable msgParts
static java.util.Hashtable msgAuth
Constructor Detail |
DBLow(ServerConfig config)
config
- Server configuration dataMethod Detail |
boolean areaExists(java.lang.String area)
area
- Path to the areapublic long length(java.lang.String url)
url
- Object urlpublic long lastModified(java.lang.String url)
url
- Object urlvoid createArea(java.lang.String path)
path
- Path to the areavoid addFile(java.lang.String path, java.io.InputStream is, boolean apnd)
path
- Path to the object fileis
- Data to put in the fileapnd
- true if data should be appended, false means overwritejava.io.InputStream getFileStream(java.lang.String path)
path
- Path to the objectjava.io.File partfile(java.lang.String url, java.lang.String part, boolean full)
url
- URL, which may correspond to a file/directory pathpart
- Last part of path, or nullfull
- True if url is known to correspond to an absolute pathjava.lang.String partpath(java.lang.String url, java.lang.String part, boolean full)
url
- Message url (like "/mail/7/")part
- Part identification (like "part-3")full
- True if url is known to correspond to an absolute pathboolean isMailSpool(java.lang.String path)
path
- File path (must be non-null)java.io.InputStream msgPartStream(java.lang.String rId, java.lang.String partName, java.io.File msgfile, java.lang.String sid)
rId
- Message id, or file path if partName == nullpartName
- Name of partmsgfile
- Path of spool filejava.lang.String basedRef(java.lang.String ref)
ref
- Full (starting with servletBase) or relative refboolean findPart(java.lang.String path, java.lang.String sid)
path
- File path for partsid
- Security idprotected void validate(java.lang.String id, java.lang.String part, java.lang.String sid)
private void validate(java.lang.String p, java.lang.String sid)
p
- Path of file, key to table datasid
- Authorization for accessing p dataprivate boolean accessPart(java.lang.String p, java.lang.String sid)
p
- Path of componentsid
- Security idvoid replaceMime(java.lang.String path, java.lang.String repl)
path
- Path of file to be replaced (possibly except "text")repl
- Path of replacing file (possibly except "text")boolean removeFile(java.lang.String path)
path
- Path to the objectprotected boolean expungeFile(java.io.File f)
f
- Abstract file pathjava.lang.String[] listFiles(java.lang.String path, java.lang.String pfx)
path
- Directory pathpfx
- Prefix of names to be included, or nulljava.lang.String updseq1(java.lang.String path, boolean update, java.lang.String value)
path
- Path to a file which should contain a sequence numberupdate
- true: update to next sequence numbervalue
- If non-null, use this value as sequence numberjava.io.InputStream getStandard(java.lang.String url)
url
- File urlfinal java.lang.String getFileContents(java.lang.String url)
url
- File urlprotected final java.io.File getFile(java.lang.String fRef)
fRef
- File reference stringjava.lang.String getPath(java.lang.String fRef)
fRef
- File referencejava.lang.String File2String(java.io.File f)
f
- Fileprivate java.io.InputStream File2Stream(java.io.File f)
f
- Filevoid makePart(java.lang.String rId, java.lang.String part, java.io.InputStream b)
rId
- Object ref, or full pathpart
- Part nameb
- InputStream for part datavoid writeObject(java.lang.String name, java.lang.Object obj)
name
- Name of CDB fileobj
- Objectjava.lang.Object readObject(java.lang.String name)
name
- Name of CDB filevoid debugLog(java.lang.String s)
void errorLog(java.lang.String s)
void printStackTrace(java.lang.Throwable x, java.lang.String debugmessage)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |