|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.impl.cm.Cm
This class implements a limited document storing mechanism intended to provide a mean for DiscoveryService, ResolverService, PipeResolver and Cache services to search and exchange documents over the group. Only Core Services are intended to use this mechanism, the security relies on the generic PeerGroup security service. XXX: this need to be optimized
Field Summary | |
static boolean |
debug
|
static java.lang.String |
PrivateDirName
|
static java.lang.String |
PublicDirName
|
static java.lang.String |
RootDirBase
|
static java.lang.String |
TmpDirName
|
Constructor Summary | |
Cm()
Makes a temporary storage area with a unique name. |
|
Cm(java.lang.String areaName)
|
Method Summary | |
void |
cleanupFolder(java.lang.String dn)
Returns true if the directory exists |
void |
createFolder(java.lang.String f)
Creates a new folder. |
static java.lang.String |
createTmpName()
Generates a random file name |
static java.lang.String |
createTmpName(net.jxta.document.StructuredDocument doc)
Generates a random file name using doc hashcode |
boolean |
exists(java.lang.String dn,
java.lang.String fn)
Tests if a file does exist |
java.lang.String[] |
getFileNames(java.lang.String dn)
Gets the list of all the files into the given folder |
java.io.FileInputStream |
getInputStream(java.lang.String dn,
java.lang.String fn)
|
java.lang.String |
getOldestFile(java.lang.String dn)
Returns the name of the oldest file in a given directory |
boolean |
isFolder(java.lang.String dn)
Returns true if the directory exists |
void |
publish(net.jxta.document.StructuredDocument doc)
Publish a document that can be searched by other peers. |
void |
publish(net.jxta.document.StructuredDocument doc,
java.lang.String fn)
|
void |
remove(java.lang.String dn,
java.lang.String fn)
Remove a file |
net.jxta.document.StructuredDocument |
restore(java.lang.String dn,
java.lang.String fn)
Restore a saved file |
byte[] |
restoreBytes(java.lang.String dn,
java.lang.String fn)
|
void |
save(java.lang.String dn,
java.lang.String fn,
net.jxta.document.StructuredDocument doc)
Saves a StructuredDocument into a folder |
void |
saveBytes(java.lang.String dn,
java.lang.String fn,
byte[] buffer)
|
java.util.Enumeration |
search(java.lang.String dn,
java.lang.String tag,
java.lang.String value)
Search and recovers documents that contains at least a mathing pair of tag/value. |
java.util.Enumeration |
searchLocal(java.lang.String dn,
java.lang.String tag,
java.lang.String value)
Search and recovers documents that contains at least a mathing pair of tag/value. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static boolean debug
public static final java.lang.String RootDirBase
public static final java.lang.String PublicDirName
public static final java.lang.String PrivateDirName
public static final java.lang.String TmpDirName
Constructor Detail |
public Cm()
public Cm(java.lang.String areaName)
Method Detail |
public void createFolder(java.lang.String f) throws java.io.IOException
f
- contains the name of the new folderpublic static java.lang.String createTmpName()
public static java.lang.String createTmpName(net.jxta.document.StructuredDocument doc)
doc
- to hash to generate a unique namepublic void remove(java.lang.String dn, java.lang.String fn) throws java.io.IOException
dn
- contains the name of the folderfn
- contains the name of the filepublic boolean exists(java.lang.String dn, java.lang.String fn) throws java.io.IOException
dn
- contains the name of the folderfn
- contains the name of the filepublic net.jxta.document.StructuredDocument restore(java.lang.String dn, java.lang.String fn) throws java.io.IOException
dn
- contains the name of the folderfn
- contains the name of the filepublic byte[] restoreBytes(java.lang.String dn, java.lang.String fn) throws java.io.IOException
public void save(java.lang.String dn, java.lang.String fn, net.jxta.document.StructuredDocument doc) throws java.io.IOException
dn
- contains the name of the folderfn
- contains the name of the filedoc
- contains the StructuredDocument to savepublic void saveBytes(java.lang.String dn, java.lang.String fn, byte[] buffer) throws java.io.IOException
public java.lang.String[] getFileNames(java.lang.String dn)
dn
- contains the name of the folderpublic java.lang.String getOldestFile(java.lang.String dn)
dn
- contains the name of the folderpublic boolean isFolder(java.lang.String dn)
dn
- contains the name of the folderpublic void cleanupFolder(java.lang.String dn) throws java.io.IOException
dn
- contains the name of the folderpublic java.util.Enumeration search(java.lang.String dn, java.lang.String tag, java.lang.String value)
dn
- contains the name of the folder on which to perform the searchtag
- contains the name of the tag on which to search onvalue
- contains the value to search on.public void publish(net.jxta.document.StructuredDocument doc)
doc
- is a StructuredDocument to be publishedpublic void publish(net.jxta.document.StructuredDocument doc, java.lang.String fn)
public java.util.Enumeration searchLocal(java.lang.String dn, java.lang.String tag, java.lang.String value)
tag
- contains the name of the tag on which to search onvalue
- contains the value to search on.public java.io.FileInputStream getInputStream(java.lang.String dn, java.lang.String fn) throws java.io.IOException
|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |