|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.io.fileio.htaccess.HypertextAccessFile
public class HypertextAccessFile
This is a simple class for reading htaccess files.
Constructor Summary | |
---|---|
protected |
HypertextAccessFile()
This class cannot be instantiated directly; it's only meant for reading files. |
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
getAddedCharsets()
This method returns the file that was set by the "AddCharset" directive(s). |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getAddedHandlers()
This method returns the file that was set by the "AddHandler" directive(s). |
java.util.Map<java.lang.String,java.lang.String> |
getAddedTypes()
This method returns the file that was set by the "AddType" directive(s). |
java.io.File |
getAuthGroupFile()
This method returns the file that was set by the "AuthGroupFile" directive (or null if not set). |
java.lang.String |
getAuthName()
This method returns the value from the "AuthName" directive or null if not set. |
java.lang.String |
getAuthType()
This method returns the value from the "AuthType" directive or null if not set. |
java.io.File |
getAuthUserFile()
This method returns the file that was set by the "AuthUserFile" directive (or null if not set). |
java.lang.String |
getDefaultCharset()
This method returns the charset that was set by the "AddDefaultCharset" directive (or null if not set). |
java.util.List<java.lang.String> |
getDirectoryIndexList()
This method returns the file names that were set by the "DirectoryUndex" directive(s). |
java.util.Map<java.lang.Integer,java.lang.String> |
getErrorDocumentMap()
This method returns the status code/error document map defined by all "ErrorDocument" directive(s). |
java.util.Map<java.lang.String,java.lang.Boolean> |
getOptions()
This method returns the file that was set by the "Option" directive(s). |
java.util.List<java.lang.String> |
getRequiredGroups()
This method returns the file that was set by the "Require Group" directive(s). |
java.util.List<java.lang.String> |
getRequiredUsers()
This method returns the file that was set by the "Require User" directive(s). |
java.lang.String |
getSetHandler()
This method returns the name that was set by the "SetHandler" directive(s). |
java.io.File |
getSourceFile()
This method returns the source file the htaccess configuration was read from. |
static void |
main(java.lang.String[] argv)
For testing only. |
void |
merge(HypertextAccessFile mergeFrom)
This method merges all non-empty settings from the passed hypertext access file. |
static HypertextAccessFile |
read(java.io.File file,
boolean strictMode)
Reads the htaccess configuration from the given file. |
static HypertextAccessFile |
read(java.io.InputStream in,
boolean strictMode)
Reads the htaccess configuration from the given inputstream. |
static HypertextAccessFile |
read(java.io.LineNumberReader lnr,
boolean strictMode)
Reads the htaccess configuration from the given line number reader. |
boolean |
requiresValidUser()
This method returns the flag that is set by the "Require valid-user" directive. |
java.lang.String |
toString()
|
java.lang.StringBuffer |
toString(java.lang.StringBuffer b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected HypertextAccessFile()
Method Detail |
---|
public static HypertextAccessFile read(java.io.File file, boolean strictMode) throws java.io.IOException, java.text.ParseException
file
- The input file (must be a text file in .htaccess format).strictMode
- If this mode is set to true the reader will NOT ignore any unknown/unexpected
irregularities but throw a ParseException. There are even some un-handled keywords
which still lack some implementation (set to false if you want to ignore them).
java.io.IOException
- If any IO errors occur.
java.text.ParseException
- If the passed file cannot be parsed or is not a htaccess file.public static HypertextAccessFile read(java.io.InputStream in, boolean strictMode) throws java.io.IOException, java.text.ParseException
in
- The input stream (must deliver a text file in .htaccess format).strictMode
- If this mode is set to true the reader will NOT ignore any unknown/unexpected
irregularities but throw a ParseException. There are even some un-handled keywords
which still lack some implementation (set to false if you want to ignore them).
java.io.IOException
- If any IO errors occur.
java.text.ParseException
- If the passed data cannot be parsed or is not a htaccess file.public static HypertextAccessFile read(java.io.LineNumberReader lnr, boolean strictMode) throws java.io.IOException, java.text.ParseException
lnr
- The line number reader to read the data from (must deliver a text file in .htaccess format).strictMode
- If this mode is set to true the reader will NOT ignore any unknown/unexpected
irregularities but throw a ParseException. There are even some un-handled keywords
which still lack some implementation (set to false if you want to ignore them).
java.io.IOException
- If any IO errors occur.
java.text.ParseException
- If the passed data cannot be parsed or is not a htaccess file.public java.io.File getSourceFile()
public java.lang.String getAuthType()
public java.lang.String getAuthName()
public java.io.File getAuthUserFile()
public java.io.File getAuthGroupFile()
public java.util.List<java.lang.String> getRequiredGroups()
public java.util.List<java.lang.String> getRequiredUsers()
public boolean requiresValidUser()
public java.util.Map<java.lang.String,java.lang.String> getAddedTypes()
public java.util.Map<java.lang.String,java.lang.Boolean> getOptions()
public java.lang.String getSetHandler()
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAddedHandlers()
public java.lang.String getDefaultCharset()
public java.util.Map<java.lang.String,java.lang.String> getAddedCharsets()
public java.util.List<java.lang.String> getDirectoryIndexList()
public java.util.Map<java.lang.Integer,java.lang.String> getErrorDocumentMap()
public void merge(HypertextAccessFile mergeFrom) throws java.lang.NullPointerException
mergeFrom
- The hypertext access file containing the settings to be merge into
this (must not be null).
java.lang.NullPointerException
- If mergeFrom param is null.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.StringBuffer toString(java.lang.StringBuffer b)
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |