|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.curn.CurnUtil
public class CurnUtil
Miscellaneous utility methods that are shared among classes, but don't logically belong anywhere in particular.
| Nested Class Summary | |
|---|---|
static class |
CurnUtil.IndexMarker
Constants defining where rolled file indicators should go in the file name pattern. |
| Method Summary | |
|---|---|
static java.io.File |
createTempXMLFile()
Create a temporary file for XML content. |
static java.io.PrintWriter |
getErrorOut()
Get a PrintWriter for writing error messages to the screen. |
static java.util.ResourceBundle |
getResourceBundle(java.util.Locale locale)
Get the resource bundle. |
static java.lang.String |
getResourceFromBundle(java.lang.String key,
java.util.Locale locale)
Get a string (resource) from the resource bundle. |
static java.lang.String |
makeRollingFileWriterPattern(java.io.File file,
CurnUtil.IndexMarker indexMarkerLoc)
Transform a File object into a RollingFileWriter pattern. |
static java.io.File |
mapConfiguredPathName(java.lang.String pathName)
Map a configured path name to a File object. |
static java.net.URL |
normalizeURL(java.lang.String url)
Normalize a URL, by forcing its host name and protocol to lower case. |
static java.net.URL |
normalizeURL(java.net.URL url)
Normalize a URL, by forcing its host name and protocol to lower case. |
static java.io.PrintWriter |
openOutputFile(java.io.File file,
java.lang.String encoding,
CurnUtil.IndexMarker indexMarkerLoc,
int totalBackups)
Open a file that might require backing up. |
static java.lang.String |
urlToLookupKey(java.net.URL url)
Convert a URL to a lookup key, by normalizing it and converting it to a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.net.URL normalizeURL(java.net.URL url)
url - The URL to normalize.
normalizeURL(String)
public static java.net.URL normalizeURL(java.lang.String url)
throws java.net.MalformedURLException
url - The URL to normalize, as a string
java.net.MalformedURLException - bad URL stringnormalizeURL(URL)public static java.lang.String urlToLookupKey(java.net.URL url)
url - the URL
public static java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
locale - the locale to use, or null for the default
Constants.BUNDLE_NAME,
getResourceFromBundle(java.lang.String, java.util.Locale)
public static java.lang.String getResourceFromBundle(java.lang.String key,
java.util.Locale locale)
key - the key for the resource to look uplocale - the locale to use, or null for the default
Constants.BUNDLE_NAME,
getResourceBundle(java.util.Locale)
public static java.lang.String makeRollingFileWriterPattern(java.io.File file,
CurnUtil.IndexMarker indexMarkerLoc)
file - the fileindexMarkerLoc - where the RollingFileWriter index marker
should go
public static java.io.File createTempXMLFile()
throws java.io.IOException
java.io.IOException - error creating temporary file
public static java.io.PrintWriter openOutputFile(java.io.File file,
java.lang.String encoding,
CurnUtil.IndexMarker indexMarkerLoc,
int totalBackups)
throws org.clapper.util.io.IOExceptionExt
file - the file to openencoding - encoding to use when opening the file, or null
for the defaulttotalBackups - total backups to keep, if positiveindexMarkerLoc - where the RollingFileWriter index marker
should go. Ignored unless totalBackups
is positive.
org.clapper.util.io.IOExceptionExt - on errorpublic static java.io.PrintWriter getErrorOut()
public static java.io.File mapConfiguredPathName(java.lang.String pathName)
pathName - the path name to map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||