|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.util.FileRepository
final class FileRepository
This class allows to use a filesystem directory as repository with the NTransaction module.
NTransaction
,
Repository
Field Summary | |
---|---|
private int |
baddeleted
The number of useless delete operation on repository. |
(package private) java.io.File |
dir
|
private int |
nbdeleted
The number of delete operation on repository. |
private int |
nbloaded
The number of load operation from repository. |
private int |
nbsaved
The number of save operation to repository. |
private boolean |
useFileOutputStream
Boolean value to force the use of FileOutputStream rather than RandomAccessFile. |
Constructor Summary | |
---|---|
FileRepository()
|
Method Summary | |
---|---|
void |
close()
Closes the repository. |
void |
commit()
Commits all changes to the repository. |
void |
delete(java.lang.String dirName,
java.lang.String name)
Deletes the corresponding objects in repository. |
private void |
deleteDir(java.io.File dir)
Delete the specified directory if it is empty. |
int |
getNbBadDeletedObjects()
Returns the number of useless delete operation on repository. |
int |
getNbDeletedObjects()
Returns the number of delete operation on repository. |
int |
getNbLoadedObjects()
Returns the number of load operation from repository. |
int |
getNbSavedObjects()
Returns the number of save operation to repository. |
void |
init(java.io.File dir)
Initializes the repository. |
java.lang.String[] |
list(java.lang.String prefix)
Gets a list of persistent objects that name corresponds to prefix. |
byte[] |
load(java.lang.String dirName,
java.lang.String name)
Loads the byte array. |
void |
save(java.lang.String dirName,
java.lang.String name,
byte[] content)
Save the corresponding bytes array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.io.File dir
private int nbsaved
private int nbdeleted
private int baddeleted
private int nbloaded
private boolean useFileOutputStream
This property can be fixed only from java
launching
command, or through System.property method.
Constructor Detail |
---|
FileRepository()
Method Detail |
---|
public int getNbSavedObjects()
getNbSavedObjects
in interface Repository
public int getNbDeletedObjects()
getNbDeletedObjects
in interface Repository
public int getNbBadDeletedObjects()
getNbBadDeletedObjects
in interface Repository
public int getNbLoadedObjects()
getNbLoadedObjects
in interface Repository
public void init(java.io.File dir) throws java.io.IOException
init
in interface Repository
java.io.IOException
public java.lang.String[] list(java.lang.String prefix) throws java.io.IOException
list
in interface Repository
java.io.IOException
public void save(java.lang.String dirName, java.lang.String name, byte[] content) throws java.io.IOException
save
in interface Repository
java.io.IOException
public byte[] load(java.lang.String dirName, java.lang.String name) throws java.io.IOException
load
in interface Repository
java.io.IOException
public void delete(java.lang.String dirName, java.lang.String name) throws java.io.IOException
delete
in interface Repository
java.io.IOException
private final void deleteDir(java.io.File dir)
public void commit() throws java.io.IOException
commit
in interface Repository
java.io.IOException
public void close() throws java.io.IOException
close
in interface Repository
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |