| java.lang.Object org.apache.cocoon.util.IOUtils
IOUtils | public class IOUtils (Code) | | A collection of File , URL and filename
utility methods
author: Ricardo Rocha author: Stefano Mazzocchi version: CVS $Id: IOUtils.java 433543 2006-08-22 06:22:54Z crossley $ |
englishCollator | final static Collator englishCollator(Code) | | Collator for comparing the strings
|
keywordSuffix | final static char keywordSuffix(Code) | | Use this character as suffix
|
keywords | final static String keywords(Code) | | These are java keywords as specified at the following URL (sorted alphabetically).
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#229308
|
baseName | public static String baseName(String filename)(Code) | | Strip a filename of its last extension (the portion
immediately following the last dot character, if any)
Parameters: filename - The filename The filename sans extension |
createFile | public static File createFile(File destDir, String filename)(Code) | | Return a file with the given filename creating the necessary
directories if not present.
Parameters: filename - The file The created File instance |
deserializeString | public static String deserializeString(File file) throws IOException(Code) | | Load a text file contents as a String.
This method does not perform enconding conversions
Parameters: file - The input file The file contents as a String exception: IOException - IO Error |
fileComponent | public static String fileComponent(String filename)(Code) | | Remove path information from a filename returning only its file
component
Parameters: filename - The filename The filename sans path information |
getContextFilePath | public static String getContextFilePath(String directoryPath, String filePath)(Code) | | Return the path within a base directory
|
getFullFilename | public static String getFullFilename(File file)(Code) | | Get the complete filename corresponding to a (typically relative)
File .
This method accounts for the possibility of an error in getting
the filename's canonical path, returning the io/error-safe
absolute form instead
Parameters: file - The file The file's absolute filename |
normalizedFilename | public static String normalizedFilename(String filename)(Code) | | Return a modified filename suitable for replicating directory
structures below the store's base directory. The following
conversions are performed:
- Path separators are converted to regular directory names
- File path components are transliterated to make them valid (?)
programming language identifiers. This transformation may well
generate collisions for unusual filenames.
The transformed filename |
objectToBytes | public static byte[] objectToBytes(Object object) throws IOException(Code) | | Returns a byte array from the given object.
Parameters: object - to convert byte array from the object |
pathComponent | public static String pathComponent(String filename)(Code) | | Remove file information from a filename returning only its path
component
Parameters: filename - The filename The path information |
serializeObject | public static void serializeObject(File file, Object object) throws IOException(Code) | | This method serializes an object to an output stream.
Parameters: file - The output file Parameters: object - The object to be serialized exception: IOException - IOError |
serializeString | public static void serializeString(File file, String string) throws IOException(Code) | | Dump a String to a text file.
Parameters: file - The output file Parameters: string - The string to be dumped exception: IOException - IO Error |
serializeString | public static void serializeString(File file, String string, String encoding) throws IOException(Code) | | Dump a String to a text file.
Parameters: file - The output file Parameters: string - The string to be dumped Parameters: encoding - The encoding for the output file or null for default platform encoding exception: IOException - IO Error |
|
|