|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.ac.ebi.intact.application.intSeq.business.ManagerFiles
This class is a base class which allows to manage the file operations like opening, reading, writing, parsing, deleting. Previous command lines or URL in this project need the file creation and management. It allows to abstract other classes from the specific objects needed like File, FileWriter...
| Field Summary | |
protected java.lang.String |
absolutePath
absolute path file |
protected java.lang.String |
fileName
|
| Constructor Summary | |
ManagerFiles()
constructor by default |
|
ManagerFiles(java.lang.String pathFile,
java.lang.Object extension)
constructor which allows us to create a random file name, this application is multi-user. |
|
ManagerFiles(java.lang.String pathFile,
java.lang.String fileName)
constructor which passes a hard file name in parameter |
|
| Method Summary | |
boolean |
CreateFile()
Create a file, checking some important points before: if it already exists, and if it is readable. |
void |
CreateWriter()
if the PutInFile method needs to be managed in a loop, the FileWriter has to be created only once. |
void |
DeleteFile()
Delete a file which isn't used anymore. |
java.lang.String |
GetFileName()
to get the file name only |
protected java.lang.String |
GetLineSeparator()
get the line separator string. |
java.lang.String |
GetPathFile()
to get the absolute path of a file |
java.lang.String |
GetRandFileName(java.lang.Object extensionFile)
Generate a file name randomly, with a long added at the end of the name. |
protected java.util.ArrayList |
ParseWithReAllFollow(java.lang.String inputStr,
java.lang.String patternStr)
This method allows to parse one line with one Regular Expression in JAVA and to retrieve all items described in this RE, except the whole line. |
protected java.lang.String |
ParseWithReOneGroup(java.lang.String inputStr,
java.lang.String patternStr,
int iWhichGroup)
This method allows to parse one line of a file with a Regular Expression in JAVA and to retrieve only one item of this line. |
protected void |
PrepareBufferedReader()
This method prepares the buffered reader, to put the file managed in a buffer, which allow to work on its content and parse it. |
void |
PutInFile(java.lang.String sequence)
This method allows to write a string, more or less long, in a file which has been created before. |
java.lang.String |
ReadingFile()
This method allows to recover the file content in a String. |
java.util.ArrayList |
ResultParsing(java.util.ArrayList patternList,
int jWhichGroup)
This method parses a file with only one item requiered and returns the list of this item possibly retrieved in several lines. |
java.util.ArrayList |
ResultParsingTableFile(java.lang.String pattern)
This method parses a file from one Regular Expression given. |
void |
SetFileName(java.lang.String name)
|
void |
SetPathFile(java.lang.String path)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String absolutePath
protected java.lang.String fileName
| Constructor Detail |
public ManagerFiles()
public ManagerFiles(java.lang.String pathFile,
java.lang.Object extension)
pathFile - String to know where to put this fileextension - Object representing the logic extension behind the file name
public ManagerFiles(java.lang.String pathFile,
java.lang.String fileName)
pathFile - String to know where to put this filefileName - String to represent the hard name file| Method Detail |
public java.lang.String GetPathFile()
public void SetPathFile(java.lang.String path)
public java.lang.String GetFileName()
public void SetFileName(java.lang.String name)
public java.lang.String GetRandFileName(java.lang.Object extensionFile)
public boolean CreateFile()
public void PutInFile(java.lang.String sequence)
throws IntactException
sequence - the string which is going to full the file. It is used, for instance,
in the RunSimilaritySearch method, where the blast command need to put the query protein sequence
in a file.
IntactException
public void CreateWriter()
throws IntactException
IntactException
public java.lang.String ReadingFile()
throws IntactException
IntactExceptionpublic void DeleteFile()
public java.util.ArrayList ResultParsing(java.util.ArrayList patternList,
int jWhichGroup)
throws IntactException
patternList - while there are pattern strings in this list (corresponds to Regular
Expression, we have to continue the parsing with this string.jWhichGroup - decides which group of the regular expression is retrieved.
IntactException
public java.util.ArrayList ResultParsingTableFile(java.lang.String pattern)
throws IntactException
ResultParsing method.
pattern - string which corresponds to a regular expression which will allow to
parse the file.
IntactException
protected void PrepareBufferedReader()
throws IntactException
IntactException
protected java.lang.String ParseWithReOneGroup(java.lang.String inputStr,
java.lang.String patternStr,
int iWhichGroup)
inputStr - the line reading in the file.patternStr - the Regular Expression which describes the file line to retrieve.iWhichGroup - to choose which group will be retrieved from the RE (if it is equal
to 0, the whole line is retrieved).
protected java.util.ArrayList ParseWithReAllFollow(java.lang.String inputStr,
java.lang.String patternStr)
groupStr retrieves items requiered by the regular expression.
So, each group is added in the result ArrayList, like a String.
inputStr - the current line reading in the file.patternStr - the Regular Expression which describes the file line to retrieve.
protected java.lang.String GetLineSeparator()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||