|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.ui.xnode.XNodeCollectionImporter
public class XNodeCollectionImporter
A utility used to import the files found in a directory into an XNodeCollection.
The ExtensionFileFilter controlling the file types can be supplied at
instantiation time or the importer will use the default (*.txt, *.html, *.htm,
and *.xml). Once run the start() method is not reentrant.
This was originally written as a Thread hence the start() method, but
has since been demoted to a simple class. If the setup doesn't work or the user
cancels, the start is ignored.
The file extensions will be stripped from the filenames and used as IDs so long as this works: if either a conflict occurs or an ID is invalid, the user is queried for a valid ID.
Note: There is no XNode overwrite protection for this importer: this should only be used to import into a new, empty XNodeCollection.
| Field Summary | |
|---|---|
static String |
ISO_8859_1_ENCODING
|
static int |
m_filecount_query_threshold
The threshold in file count after which the user is asked whether or not to continue. |
static String |
UTF_8_ENCODING
|
| Constructor Summary | |
|---|---|
XNodeCollectionImporter(String cid,
File dir,
ExtensionFileFilter filter,
Desktop desktop,
ActionListener listener)
Import the files found in directory dir into XNodeCollection cid. |
|
| Method Summary | |
|---|---|
void |
start()
Start the import process. |
protected String |
unmangleName(String filename)
This is the reverse of JSPWiki's mangleName. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int m_filecount_query_threshold
public static final String ISO_8859_1_ENCODING
public static final String UTF_8_ENCODING
| Constructor Detail |
|---|
public XNodeCollectionImporter(String cid,
File dir,
ExtensionFileFilter filter,
Desktop desktop,
ActionListener listener)
throws XNodeException,
IOException
All checks for directory writeability and such are done on construction.
cid - the Collection IDdir - the source directoryfilter - the optional ExtensionFileFilter to filter imported files by file extensiondesktop - the application Desktoplistener - the optional ActionListener to receive an event upon completion
IOException - if unable to locate or read from the directory
XNodeException - if unable to get the XNodeCollection or any XNodeStore
failure occurs during import| Method Detail |
|---|
public void start()
throws IllegalStateException
IllegalStateException - if the collection has been cancelled, could not
be established, or has already finished.protected String unmangleName(String filename)
AbstractFileProvider.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||