|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nonesole.persistence.file.FileWrapper
public class FileWrapper
File wrapper
Constructor Summary | |
---|---|
FileWrapper(java.net.URL url)
Construction |
Method Summary | |
---|---|
void |
clear()
Clear and reset parameter. |
void |
destroy()
Destroy current object |
boolean |
hasMore()
If or not have next line to reading. |
void |
lock()
Lock file channel |
java.lang.String |
readAll()
Read file to string. |
java.lang.String |
readAll(boolean isLock)
Read file to string. |
java.lang.String |
readLine()
Read one line of string |
void |
release()
Release file channel. |
void |
replace(java.lang.String regex,
java.lang.String replacement)
Replace what user want to erase or rewrite. |
void |
setCharset(java.lang.String charset)
Set current charset Please refer to com.nonesole.persistence.file.AuailableCharsets |
void |
write(java.lang.String str)
Write content at tail of file |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileWrapper(java.net.URL url) throws OperationsException, java.io.IOException
url
- - URL
OperationsException
java.io.IOException
Method Detail |
---|
public void setCharset(java.lang.String charset)
charsetType
- the charsetType to setpublic void clear() throws java.io.IOException
java.io.IOException
public boolean hasMore() throws java.io.IOException
java.io.IOException
public java.lang.String readAll() throws java.io.IOException
java.io.IOException
public java.lang.String readAll(boolean isLock) throws java.io.IOException
isLock
- - true means lock file channel when read file
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
public void write(java.lang.String str) throws OperationsException, java.io.IOException
str
-
OperationsException
java.io.IOException
public void replace(java.lang.String regex, java.lang.String replacement) throws java.io.IOException, OperationsException
regex
- replacement
-
java.io.IOException
OperationsException
public void release() throws java.io.IOException
java.io.IOException
public void destroy() throws java.io.IOException
java.io.IOException
public void lock() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |