public class GMFFInputFile
extends java.lang.Object
Constructor and Description |
---|
GMFFInputFile(java.io.File file,
java.lang.String exportType,
java.lang.String errorMessageDescriptor,
int bufferSize)
Standard constructor.
|
GMFFInputFile(GMFFFolder inputFolder,
java.lang.String inputFileName,
java.lang.String exportType,
java.lang.String errorMessageDescriptor,
int bufferSize)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAbsolutePath()
Returns the absolute pathname of the GMFFInputFile
|
static java.lang.String |
getFileContents(java.io.File file,
java.lang.String exportType,
java.lang.String errorMessageDescriptor,
int bufferSize)
Returns the contents of a file as a
String . |
static java.lang.String |
getFileContents(GMFFFolder inputFolder,
java.lang.String inputFileName,
java.lang.String exportType,
java.lang.String errorMessageDescriptor,
int bufferSize)
Returns the contents of a file as a
String . |
java.lang.String |
loadContentsToString()
Returns string containing the entire file contents.
|
public GMFFInputFile(GMFFFolder inputFolder, java.lang.String inputFileName, java.lang.String exportType, java.lang.String errorMessageDescriptor, int bufferSize) throws GMFFException
inputFolder
- a GMFFFolder holding the input fileinputFileName
- file name of file to be read.exportType
- the Export Type associated with this I/O operation --
used for error messages.errorMessageDescriptor
- name or description of what is being read
(e.g. "Proof Worksheet").bufferSize
- estimated size of the file, or at least how large the
buffer should be for reading it.GMFFException
- if other error, such as IO exception.public GMFFInputFile(java.io.File file, java.lang.String exportType, java.lang.String errorMessageDescriptor, int bufferSize)
file
- File object for the file name to be read.exportType
- the Export Type associated with this I/O operation --
used for error messages.errorMessageDescriptor
- name or description of what is being read
(e.g. "Proof Worksheet").bufferSize
- estimated size of the file, or at least how large the
buffer should be for reading it.public static java.lang.String getFileContents(GMFFFolder inputFolder, java.lang.String inputFileName, java.lang.String exportType, java.lang.String errorMessageDescriptor, int bufferSize) throws GMFFException
String
.inputFolder
- a GMFFFolder holding the input fileinputFileName
- file name of file to be read.exportType
- the Export Type associated with this I/O operation --
used for error messages.errorMessageDescriptor
- name or description of what is being read
(e.g. "Proof Worksheet").bufferSize
- estimated size of the file, or at least how large the
buffer should be for reading it.GMFFException
- if other error, such as IO exception.public static java.lang.String getFileContents(java.io.File file, java.lang.String exportType, java.lang.String errorMessageDescriptor, int bufferSize) throws GMFFException
String
.file
- File object for the file name to be read.exportType
- the Export Type associated with this I/O operation --
used for error messages.errorMessageDescriptor
- name or description of what is being read
(e.g. "Proof Worksheet").bufferSize
- estimated size of the file, or at least how large the
buffer should be for reading it.GMFFException
- if other error, such as IO exception.public java.lang.String loadContentsToString() throws GMFFException
A BufferedReader
is created using the specified buffer size and a
StringBuilder
is loaded with repeated reads until end of file
reached. Then the StringBuilder is converted to a String and returned to
the called.
Obviously, this function has a problem if asked to read a humongous file. (We should test that :-)
GMFFException
- if other error, such as IOException or
SecurityException.public java.lang.String getAbsolutePath()