org.sourcejammer.project.controller
Class TextFileUtil

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

public class TextFileUtil
extends java.lang.Object

Title: $FileName: TextFileUtil.java$

Version:
$VerNum: 11$ $KeyWordsOff: $

Utility class of static methods for manipulating Text Files.
Author:
$AuthorName: Rob MacGrogan$

Constructor Summary
private TextFileUtil()
           
 
Method Summary
static void convertTextFileAsFileForRetreival(java.io.File source, java.io.File target, int requestedEOL)
           
static void convertTextFileAsFileForStorage(java.io.File file)
           
static void convertTextFileAsFileForStorage(java.io.File file, boolean expandKeywords, ProjectObjects projObj)
           
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 void convertTextFileForRetreival(java.io.InputStream stmIn, int requestedEOL, java.io.File target)
           
static void convertTextFileForStorage(byte[] file, java.io.OutputStream stmOut)
           
static void convertTextFileForStorage(java.io.InputStream inStream, boolean expandKeywords, ProjectObjects projObj, java.io.File target)
          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 convertTextFileForStorage(java.io.InputStream inStream, boolean expandKeywords, ProjectObjects projObj, java.io.OutputStream outStream)
          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 void writeTextLineIteratorToOutputStream(TextLineIteratorOutput iterator, char[] eol, java.io.OutputStream outStr)
          Writes TextLineIterator out to the specified stream, using the specified EOL characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFileUtil

private TextFileUtil()
Method Detail

convertTextFileAsFileForStorage

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

convertTextFileForStorage

public static void convertTextFileForStorage(byte[] file,
                                             java.io.OutputStream stmOut)
                                      throws TextFileException
TextFileException

convertTextFileAsFileForStorage

public static void convertTextFileAsFileForStorage(java.io.File file,
                                                   boolean expandKeywords,
                                                   ProjectObjects projObj)
                                            throws TextFileException,
                                                   FileAccessException
TextFileException
FileAccessException

convertTextFileForStorage

public static void convertTextFileForStorage(java.io.InputStream inStream,
                                             boolean expandKeywords,
                                             ProjectObjects projObj,
                                             java.io.File target)
                                      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.

TextFileException

convertTextFileForStorage

public static void convertTextFileForStorage(java.io.InputStream inStream,
                                             boolean expandKeywords,
                                             ProjectObjects projObj,
                                             java.io.OutputStream outStream)
                                      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.

TextFileException

convertTextFileAsFileForRetreival

public static void convertTextFileAsFileForRetreival(java.io.File source,
                                                     java.io.File target,
                                                     int requestedEOL)
                                              throws TextFileException,
                                                     FileAccessException,
                                                     org.sourcejammer.util.SourceJammerVersionException
TextFileException
FileAccessException
org.sourcejammer.util.SourceJammerVersionException

convertTextFileForRetreival

public static void convertTextFileForRetreival(java.io.InputStream stmIn,
                                               int requestedEOL,
                                               java.io.File target)
                                        throws TextFileException,
                                               org.sourcejammer.util.SourceJammerVersionException
TextFileException
org.sourcejammer.util.SourceJammerVersionException

convertTextFileForRetreival

public static byte[] convertTextFileForRetreival(byte[] file,
                                                 int requestedEOL)
                                          throws TextFileException,
                                                 org.sourcejammer.util.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.

TextFileException
org.sourcejammer.util.SourceJammerVersionException

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.

TextFileException

writeTextLineIteratorToOutputStream

public static void writeTextLineIteratorToOutputStream(TextLineIteratorOutput iterator,
                                                       char[] eol,
                                                       java.io.OutputStream outStr)
                                                throws java.io.IOException
Writes TextLineIterator out to the specified stream, using the specified EOL characters.

java.io.IOException


Copyright 2003 Soucejammer project.