| java.lang.Object org.clapper.curn.CurnUtil
CurnUtil | public class CurnUtil (Code) | | Miscellaneous utility methods that are shared among classes,
but don't logically belong anywhere in particular.
version: $Revision: 7041 $ |
Inner Class :public enum IndexMarker | |
createTempXMLFile | public static File createTempXMLFile() throws IOException(Code) | | Create a temporary file for XML content.
the temp file throws: IOException - error creating temporary file |
getErrorOut | public static PrintWriter getErrorOut()(Code) | | Get a PrintWriter for writing error messages to the screen.
a suitable PrintWriter |
getResourceFromBundle | public static String getResourceFromBundle(String key, Locale locale)(Code) | | Get a string (resource) from the resource bundle.
Parameters: key - the key for the resource to look up Parameters: locale - the locale to use, or null for the default the resource bundle, or null if the resource doesn't exist See Also: Constants.BUNDLE_NAME See Also: CurnUtil.getResourceBundle |
makeRollingFileWriterPattern | public static String makeRollingFileWriterPattern(File file, IndexMarker indexMarkerLoc)(Code) | | Transform a File object into a RollingFileWriter
pattern.
Parameters: file - the file Parameters: indexMarkerLoc - where the RollingFileWriter index markershould go the transformed path string |
mapConfiguredPathName | public static File mapConfiguredPathName(String pathName)(Code) | | Map a configured path name to a File object. This method parses
the path name and converts any Unix-style path separators to the
appropriate separator for the current platform. Use of this method
allows Unix-style paths in the configuration file, even on non-Unix
systems (which also bypasses some parsing issues).
Parameters: pathName - the path name to map an appropriate File object for the current system. |
normalizeURL | public static URL normalizeURL(URL url)(Code) | | Normalize a URL, by forcing its host name and protocol to lower
case.
Parameters: url - The URL to normalize. a new URL object representing the normalized URL See Also: CurnUtil.normalizeURL(String) |
openOutputFile | public static Writer openOutputFile(File file, String encoding, IndexMarker indexMarkerLoc, int totalBackups) throws IOExceptionExt(Code) | | Open a file that might require backing up. Takes care of transforming
the file name into a RollingFileWriter pattern, if necessary.
Parameters: file - the file to open Parameters: encoding - encoding to use when opening the file, or nullfor the default Parameters: totalBackups - total backups to keep, if positive Parameters: indexMarkerLoc - where the RollingFileWriter index markershould go. Ignored unless totalBackupsis positive. a PrintWriter for the output throws: IOExceptionExt - on error |
urlToLookupKey | public static String urlToLookupKey(URL url)(Code) | | Convert a URL to a lookup key, by normalizing it and converting it
to a string. Calling this method ensures that everyone converts a
URL to a key the same way.
Parameters: url - the URL the lookup key (really, the normalized, stringified URL) |
|
|