Class FileIOPRP

java.lang.Object
  |
  +--FileIOPRP

public class FileIOPRP
extends java.lang.Object

Class FileIOPRP.java - used to read file I/O from local disk or URL CGI server. This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government and Djamel Medjahed (SAIC-Frederick). As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file.

Version:
$Date: 2002/10/14 20:17:17 $ $Revision: $
Author:
P. Lemkin (NCI), Djamel Medjahed (SAIC), NCI-Frederick, Frederick, MD
See Also:
ProtPlot Home

This work was derived from MAExplorer under the Mozilla 1.1 Open Source Public License by Peter Lemkin of the National Cancer Institute, an agency of the United States Government subject to the limitations noted in the accompanying LEGAL file. See licence info on http://maexplorer.sourceforge.org/


Field Summary
private  ProtPlot prp
          instance of ProtPlot
private  UtilPRP util
          instance of UtilPRP
 
Constructor Summary
(package private) FileIOPRP(ProtPlot prp)
          FileIOPRP() - constructor
 
Method Summary
 java.lang.String[] getFilesInDir(java.lang.String dir, java.lang.String ext)
          getFilesInDir() - get list of files in directory with specified file extension
 java.lang.String readData(java.lang.String fileName, java.lang.String msg)
          readData() - read data from URL or file depending on prefix.
 java.lang.String readFileFromDisk(java.lang.String fileName)
          readFileFromDisk() - Will read file from disk & returns as String Return null if failed.
 java.lang.String readFileFromUrl(java.lang.String URLaddress)
          readFileFromUrl() - read data from http URL, using JavaCGIBridge If the code has "\r\n", then map them to "\n".
(package private)  boolean writeFileToDisk(java.lang.String fileName, java.lang.String data)
          writeFileToDisk() - write string data to a local disk file.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

prp

private ProtPlot prp
instance of ProtPlot

util

private UtilPRP util
instance of UtilPRP
Constructor Detail

FileIOPRP

FileIOPRP(ProtPlot prp)
FileIOPRP() - constructor
Parameters:
prp - is instance of ProtPlot
Method Detail

readData

public java.lang.String readData(java.lang.String fileName,
                                 java.lang.String msg)
readData() - read data from URL or file depending on prefix. return null if fail.
Parameters:
fileName - to read
msg - to display while reading

readFileFromDisk

public java.lang.String readFileFromDisk(java.lang.String fileName)
readFileFromDisk() - Will read file from disk & returns as String Return null if failed.

readFileFromUrl

public java.lang.String readFileFromUrl(java.lang.String URLaddress)
readFileFromUrl() - read data from http URL, using JavaCGIBridge If the code has "\r\n", then map them to "\n". If the code has "\r" without "\n", then map them to "\n"
Parameters:
URLaddress - to read web page as string from server

writeFileToDisk

boolean writeFileToDisk(java.lang.String fileName,
                        java.lang.String data)
writeFileToDisk() - write string data to a local disk file.
Parameters:
fileName - is the full path filename to write the data
data - is the string to write to the file.
Returns:
string data for entire file if succeed, else null if fail.sy

getFilesInDir

public java.lang.String[] getFilesInDir(java.lang.String dir,
                                        java.lang.String ext)
getFilesInDir() - get list of files in directory with specified file extension
Parameters:
dir - directory to read
ext - is the file exteneions (e.g. ".prp") to match if not null, else accept all files
Returns:
list of files