|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.io.DirectoryWalker
ome.formats.importer.ImportCandidates
public class ImportCandidates
Utility class which given any File
object will determine the correct
number and members of a given import. This facility permits iterating over a
directory.
This class is NOT thread-safe.
Nested Class Summary | |
---|---|
static class |
ImportCandidates.CANCEL
Marker exception raised if the ImportCandidates.SCANNING.cancel() method is
called by an IObserver instance. |
static class |
ImportCandidates.SCANNING
Event raised during a pass through the directory structure given to ImportCandidates . |
Nested classes/interfaces inherited from class org.apache.commons.io.DirectoryWalker |
---|
org.apache.commons.io.DirectoryWalker.CancelException |
Field Summary | |
---|---|
static int |
DEPTH
|
static loci.formats.in.MetadataLevel |
METADATA_LEVEL
|
Constructor Summary | |
---|---|
ImportCandidates(int depth,
OMEROWrapper reader,
String[] paths,
IObserver observer)
Main constructor which iterates over all the paths calling DirectoryWalker.walk(File, Collection) and permitting a descent to the given
depth. |
|
ImportCandidates(OMEROWrapper reader,
String[] paths,
IObserver observer)
Calls ImportCandidates(int, OMEROWrapper, String[], IObserver)
with DEPTH as the first argument. |
Method Summary | |
---|---|
protected void |
execute(String[] paths)
Method called during ImportCandidates(OMEROWrapper, String[], IObserver)
to operate on all the given paths. |
List<ImportContainer> |
getContainers()
|
List<String> |
getPaths()
|
String |
getReaderType(String path)
Retrieve reader type for file specified in path |
String[] |
getUsedFiles(String path)
Return string of files used by container item at path |
void |
handleFile(File file,
int depth,
Collection collection)
Handle a file import |
void |
print()
Prints the "standard" representation of the groups, which is parsed by other software layers. |
protected ImportContainer |
singleFile(File file,
ImportConfig config)
Return an import container for a single file |
int |
size()
|
boolean |
wasCancelled()
|
Methods inherited from class org.apache.commons.io.DirectoryWalker |
---|
checkIfCancelled, handleCancelled, handleDirectory, handleDirectoryEnd, handleDirectoryStart, handleEnd, handleIsCancelled, handleRestricted, handleStart, walk |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEPTH
public static final loci.formats.in.MetadataLevel METADATA_LEVEL
Constructor Detail |
---|
public ImportCandidates(OMEROWrapper reader, String[] paths, IObserver observer)
ImportCandidates(int, OMEROWrapper, String[], IObserver)
with DEPTH
as the first argument.
reader
- instance used for parsing each of the paths. Not used once the
constructor completes.paths
- file paths which are searched. May be directories.observer
- IObserver
which will monitor any exceptions during
ReaderWrapper.setId(String)
. Otherwise no error
reporting takes place.public ImportCandidates(int depth, OMEROWrapper reader, String[] paths, IObserver observer)
DirectoryWalker.walk(File, Collection)
and permitting a descent to the given
depth.
depth
- number of directory levels to search down.reader
- instance used for parsing each of the paths. Not used once the
constructor completes.paths
- file paths which are searched. May be directories.observer
- IObserver
which will monitor any exceptions during
ReaderWrapper.setId(String)
. Otherwise no error
reporting takes place.Method Detail |
---|
public void print()
Groups#print()
but it does not
take the ordering of the used files into account.
public int size()
public boolean wasCancelled()
public List<String> getPaths()
public String getReaderType(String path)
path
- - absolute path for container
public String[] getUsedFiles(String path)
path
- - absolute path for container
public List<ImportContainer> getContainers()
protected void execute(String[] paths)
ImportCandidates(OMEROWrapper, String[], IObserver)
to operate on all the given paths. This will be called twice: once
without reading the files, and once (with the known total) using
reader
paths
- protected ImportContainer singleFile(File file, ImportConfig config)
file
- - single file
public void handleFile(File file, int depth, Collection collection)
handleFile
in class org.apache.commons.io.DirectoryWalker
file
- - file selecteddepth
- - depth of scancollection
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.4-dbcbce5a-b4
Copyright © 2009 The University of Dundee. All Rights Reserved.