SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

org.sourcejammer.project.controller
Class TextFileUtil

java.lang.Object
  |
  +--org.sourcejammer.project.controller.TextFileUtil

public class TextFileUtil
extends java.lang.Object

Utility class of static methods for manipulating Text Files.


Method Summary
static void convertTextFileAsFileForStorage(java.io.File file)
           
static byte[] convertTextFileForRetreival(byte[] file, int requestedEOL)
          Converts a text file as stored in the server (as a serialized TextLineIterator in byte[] form) and converts it to a straight text file using the requested end of line characters.
static byte[] convertTextFileForStorage(byte[] file)
          Converts a text file (in byte array form) into the proper format for storage and returns it as an serialized object in a byte array.
static void convertTextFileToProperFormat(FileNode ndFile, NodeLibrary library)
          Converts the entire version history of a text file previously saved to the new text file storage format.
static byte[] convertTextLineIteratorToByteArray(TextLineIteratorOutput iterator, char[] caEOL)
          Converts TextLineIterator to an array of bytes, which includes the full text file, constructed using the caEOL as the end of line characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertTextFileAsFileForStorage

public static void convertTextFileAsFileForStorage(java.io.File file)
                                            throws TextFileException,
                                                   FileAccessException

convertTextFileForStorage

public static byte[] convertTextFileForStorage(byte[] file)
                                        throws TextFileException
Converts a text file (in byte array form) into the proper format for storage and returns it as an serialized object in a byte array. Currently, proper format for storage of text files is as a TextLineReader.

convertTextFileForRetreival

public static byte[] convertTextFileForRetreival(byte[] file,
                                                 int requestedEOL)
                                          throws TextFileException,
                                                 SourceJammerVersionException
Converts a text file as stored in the server (as a serialized TextLineIterator in byte[] form) and converts it to a straight text file using the requested end of line characters. The text file is returned in byte array form.

convertTextFileToProperFormat

public static void convertTextFileToProperFormat(FileNode ndFile,
                                                 NodeLibrary library)
                                          throws TextFileException
Converts the entire version history of a text file previously saved to the new text file storage format.

convertTextLineIteratorToByteArray

public static byte[] convertTextLineIteratorToByteArray(TextLineIteratorOutput iterator,
                                                        char[] caEOL)
                                                 throws java.io.IOException
Converts TextLineIterator to an array of bytes, which includes the full text file, constructed using the caEOL as the end of line characters.

SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan