|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.das2.fsm.FileStorageModel
public class FileStorageModel
Represents a method for storing data sets in a set of files by time. The client provides a regex for the files and how each group of the regex is interpreted as a time digit. The model can then be used to provide the set of files that cover a time range, etc.
Nested Class Summary | |
---|---|
static interface |
FileStorageModel.FieldHandler
|
static class |
FileStorageModel.IntegerFieldHandler
|
Field Summary | |
---|---|
static int |
EndDay
|
static int |
EndDoy
|
static int |
EndHour
|
static int |
EndMinute
|
static int |
EndMonth
|
static int |
EndMonthName
|
static int |
EndSecond
|
static int |
EndYear2
|
static int |
EndYear4
|
static int |
Ignore
|
static int |
StartDay
|
static int |
StartDoy
|
static int |
StartHour
|
static int |
StartMinute
|
static int |
StartMonth
|
static int |
StartMonthName
|
static int |
StartSecond
|
static int |
StartYear2
|
static int |
StartYear4
|
Constructor Summary | |
---|---|
FileStorageModel(FileStorageModel parent,
FileSystem root,
java.lang.String regex,
FileStorageModel.FieldHandler[] handlers)
|
Method Summary | |
---|---|
java.lang.String |
calculateNameFor(Datum start)
return the name that this time will fall into. |
boolean |
containsFile(java.io.File file)
returns true if the file came (or could come) from this FileStorageModel. |
static FileStorageModel |
create(FileSystem root,
java.lang.String template)
%Y 4-digit year %y 2-digit year %m 2-digit month %d 2-digit day of month %j 3-digit day of year %H 2-digit hour %M 2-digit minute %b month name |
static FileStorageModel |
create(FileSystem root,
java.lang.String regex,
int[] digitList)
|
java.io.File |
getFileFor(java.lang.String name,
ProgressMonitor monitor)
retrieve the file for the name. |
java.lang.String |
getFilenameFor(Datum start,
Datum end)
|
java.io.File[] |
getFilesFor(DatumRange targetRange)
|
java.io.File[] |
getFilesFor(DatumRange targetRange,
ProgressMonitor monitor)
returns a list of files that can be used |
FileSystem |
getFileSystem()
|
java.lang.String |
getNameFor(java.io.File file)
Need a way to recover the model name of a file. |
java.lang.String[] |
getNamesFor(DatumRange targetRange)
|
java.lang.String[] |
getNamesFor(DatumRange targetRange,
ProgressMonitor monitor)
|
static java.lang.String |
getParentRegex(java.lang.String regex)
|
DatumRange |
getRangeFor(java.lang.String name)
|
java.lang.String |
getRepresentativeFile(ProgressMonitor monitor)
this is introduced to support discovery, where we just need one file to get started. |
void |
setFileWidth(int multiplier,
char digitCode)
specify each file's width when the implicit width is not correct. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int StartYear4
public static final int StartYear2
public static final int StartMonth
public static final int StartMonthName
public static final int StartDay
public static final int StartDoy
public static final int StartHour
public static final int StartMinute
public static final int StartSecond
public static final int EndYear4
public static final int EndYear2
public static final int EndMonth
public static final int EndMonthName
public static final int EndDay
public static final int EndDoy
public static final int EndHour
public static final int EndMinute
public static final int EndSecond
public static final int Ignore
Constructor Detail |
---|
public FileStorageModel(FileStorageModel parent, FileSystem root, java.lang.String regex, FileStorageModel.FieldHandler[] handlers)
Method Detail |
---|
public java.lang.String getFilenameFor(Datum start, Datum end)
public java.lang.String[] getNamesFor(DatumRange targetRange) throws java.io.IOException
java.io.IOException
public java.lang.String calculateNameFor(Datum start)
start
-
java.lang.IllegalArgumentException
- if this cannot be done.public java.lang.String[] getNamesFor(DatumRange targetRange, ProgressMonitor monitor) throws java.io.IOException
targetRange
- restrict search to range. May be null, in which case all
names are returned.
java.io.IOException
- if the filesystem cannot be listed.public java.lang.String getRepresentativeFile(ProgressMonitor monitor) throws java.io.IOException
java.io.IOException
public java.io.File[] getFilesFor(DatumRange targetRange) throws java.io.IOException
java.io.IOException
public DatumRange getRangeFor(java.lang.String name)
public boolean containsFile(java.io.File file)
public java.lang.String getNameFor(java.io.File file)
public java.io.File getFileFor(java.lang.String name, ProgressMonitor monitor) throws java.io.FileNotFoundException, java.io.IOException
java.io.IOException
- if the file cannot be transferred.
java.io.FileNotFoundException
public java.io.File[] getFilesFor(DatumRange targetRange, ProgressMonitor monitor) throws java.io.IOException
java.io.IOException
public static java.lang.String getParentRegex(java.lang.String regex)
public static FileStorageModel create(FileSystem root, java.lang.String regex, int[] digitList)
public static FileStorageModel create(FileSystem root, java.lang.String template)
public java.lang.String toString()
toString
in class java.lang.Object
public FileSystem getFileSystem()
public void setFileWidth(int multiplier, char digitCode)
digitCode
- 'Y', 'm', 'd', 'H', etc.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |