org.das2.fsm.FileStorageModelOld

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.

FileStorageModelOld( org.das2.fsm.FileStorageModelOld parent, org.das2.util.filesystem.FileSystem root, String regex, org.das2.fsm.FileStorageModelOld.FieldHandler[] handlers )


StartYear4


StartYear2


StartMonth


StartMonthName


StartDay


StartDoy


StartHour


StartMinute


StartSecond


EndYear4


EndYear2


EndMonth


EndMonthName


EndDay


EndDoy


EndHour


EndMinute


EndSecond


Ignore


calculateNameFor

calculateNameFor( Datum start ) → String

return the name that this time will fall into.

Parameters

start - a Datum

Returns:

the internal name of the file.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


containsFile

containsFile( java.io.File file ) → boolean

returns true if the file came (or could come) from this FileStorageModel.

Parameters

file - a File

Returns:

boolean

[search for examples] [view on GitHub] [view on old javadoc] [view source]


create

create( org.das2.util.filesystem.FileSystem root, String regex, int[] digitList ) → org.das2.fsm.FileStorageModelOld

Parameters

root - a FileSystem
regex - a String
digitList - an int[]

Returns:

org.das2.fsm.FileStorageModelOld

[search for examples] [view on GitHub] [view on old javadoc] [view source]

create( org.das2.util.filesystem.FileSystem root, String template ) → org.das2.fsm.FileStorageModelOld

getFileFor

getFileFor( String name, ProgressMonitor monitor ) → java.io.File

retrieve the file for the name.

Parameters

name - a String
monitor - a ProgressMonitor

Returns:

java.io.File

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFileSystem

getFileSystem( ) → org.das2.util.filesystem.FileSystem

Returns:

org.das2.util.filesystem.FileSystem

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFilenameFor

getFilenameFor( Datum start, Datum end ) → String

Parameters

start - a Datum
end - a Datum

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFilesFor

getFilesFor( DatumRange targetRange ) → java.io.File[]

Parameters

targetRange - a DatumRange

Returns:

java.io.File[]

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getFilesFor( DatumRange targetRange, ProgressMonitor monitor ) → java.io.File[]

getNameFor

getNameFor( java.io.File file ) → String

Need a way to recover the model name of a file. The returned File from getFilesFor can be anywhere, so it would be good to provide a way to get it back into a FSM name.

Parameters

file - a File

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getNamesFor

getNamesFor( DatumRange targetRange ) → String[]

Parameters

targetRange - restrict search to range. May be null, in which case all names are returned.

Returns:

java.lang.String[]

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getNamesFor( DatumRange targetRange, ProgressMonitor monitor ) → String[]

getParentRegex

getParentRegex( String regex ) → String

Parameters

regex - a String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getRangeFor

getRangeFor( String name ) → DatumRange

Parameters

name - a String

Returns:

org.das2.datum.DatumRange

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getRepresentativeFile

getRepresentativeFile( ProgressMonitor monitor ) → String

this is introduced to support discovery, where we just need one file to get started. Before, there was code that would list all files, then use just the first one. This may return a skeleton file, but getFileFor() must return a result. This implementation does the same as getNames(), but stops after finding a file.

Parameters

monitor - a ProgressMonitor

Returns:

null if no file is found

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setFileWidth

setFileWidth( int multiplier, char digitCode ) → void

specify each file's width when the implicit width is not correct. For example, files are stored with a tag for the starting day, but actually span a week. The width must be an integer multiple of one year, month, day, hour, minute, or second.

Parameters

multiplier - an int
digitCode - 'Y', 'm', 'd', 'H', etc.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


toString

toString( ) → String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]