Package ucar.unidata.data
Class FilesDataSource
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
ucar.unidata.data.FilesDataSource
- All Implemented Interfaces:
Sharable
,DataSource
,DataSourceFactory
,XmlPersistable
- Direct Known Subclasses:
CDMProfilerDataSource
,DemDataSource
,DrawingDataSource
,FrontDataSource
,GeotiffDataSource
,GridDataSource
,ImageXmlDataSource
,JsonDataSource
,KmlDataSource
,MovieDataSource
,PlaceFileDataSource
,PointCloudDataSource
,PointDataSource
,RadarDataSource
,SerializedDataSource
,ShapeFileDataSource
,TextDataSource
,TextProductDataSource
,TrackDataSource
,VisadDataSource
A data source for balloon and aircraft tracks
- Version:
- $Revision: 1.26 $ $Date: 2007/06/21 12:30:01 $
- Author:
- IDV Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List
List of sources filesprotected String
for unpersistenceprotected List
List of sources filesFields inherited from class ucar.unidata.data.DataSourceImpl
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES
Fields inherited from interface ucar.unidata.data.DataSource
DATAPATH_DATE_FORMAT, DATAPATH_DATE_PATTERN, MOST_RECENT, ordinalNames, PROP_AUTOCREATEDISPLAY, PROP_BASEDIRECTORY, PROP_CACHEABLE, PROP_DATACHOICENAME, PROP_DISPLAYPROPERTIES, PROP_DOCUMENTLINKS, PROP_FILEPATTERN, PROP_GEOLOCATION, PROP_ICON, PROP_NAME, PROP_POLLINFO, PROP_RESOLVERURL, PROP_SERVICE_HTTP, PROP_SUBPROPERTIES, PROP_TIMELABELS, PROP_TIMESTRIDE, PROP_TITLE
-
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorFilesDataSource
(DataSourceDescriptor descriptor) FilesDataSource
(DataSourceDescriptor descriptor, String name, String description, Hashtable properties) CtorFilesDataSource
(DataSourceDescriptor descriptor, List newSources, String name, String description, Hashtable properties) Create a TrackDataSource from the specification given.FilesDataSource
(DataSourceDescriptor descriptor, List newSources, String description, Hashtable properties) Ctor -
Method Summary
Modifier and TypeMethodDescriptionvoid
doRemove()
Called when Datasource is removed.boolean
Are we equalsprotected String
getDataFileExtension
(String file) Get the file extensionGet the file paths (or urls or whatever) that are to be changed when we are unpersisted and are in data relative modeprotected String
Get the first file path in the sources listget the detailed descriptionprotected List
getInputStreams
(List processedSources) Get a list of input streams, one for each given fileprotected List
Get the location where we poll.Return the human readable description of this DataSourceprotected String
Get the string value of the first entry in the sources listGet the source property (filename or URL).boolean
Do I have any sourcesvoid
Initialize after we have been directly createdvoid
Initialize after XML decoding.protected void
Initialze sources from polling infoprotected boolean
Are we getting data from a file or from servervoid
newFilesFromPolling
(List files) If we are polling some directory this method gets called when there is a new file.protected String
processDataFilename
(String filename, int index) Process the file name to get a file that we can use to write to local diskprotected void
The user changed the properties.void
Clear out and reinitialize the trackvoid
reloadData
(Object object, Hashtable properties) Reload dataprotected List
saveDataToLocalDisk
(String prefix, Object loadId, boolean changeLinks) Save the data source files to local diskvoid
setNewFiles
(List files) Used to change the files we use when loaded in from a bundlevoid
Set the list of sources to be a list containing the given valuevoid
setSources
(List value) Set the sources property (filename or URL).protected void
Something changedvoid
updateState
(Object newObject, Hashtable newProperties) This gets called when the user interactively does a Change dataMethods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addDataChoice, addPropertiesTabs, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canCacheDataToDisk, canChangeData, canDoAllLevels, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeDataChoices, doMakeDateTimes, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, notifyDataChange, putCache, putCache, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, writeFieldMaskFile, writeFieldMaskFile
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ucar.unidata.data.DataSource
getUniqueId
-
Field Details
-
sources
List of sources files -
adapters
List of sources files -
oldSourceFromBundles
for unpersistence
-
-
Constructor Details
-
FilesDataSource
public FilesDataSource()Default Constructor -
FilesDataSource
-
FilesDataSource
public FilesDataSource(DataSourceDescriptor descriptor, String name, String description, Hashtable properties) Ctor- Parameters:
descriptor
- The descriptorname
- The namedescription
- The long nameproperties
- properties
-
FilesDataSource
public FilesDataSource(DataSourceDescriptor descriptor, List newSources, String description, Hashtable properties) Ctor- Parameters:
descriptor
- The descriptornewSources
- List of files or urlsdescription
- The long nameproperties
- properties
-
FilesDataSource
public FilesDataSource(DataSourceDescriptor descriptor, List newSources, String name, String description, Hashtable properties) Create a TrackDataSource from the specification given.- Parameters:
descriptor
- data source descriptornewSources
- List of sources of data (filename/URL)name
- my namedescription
- description of the dataproperties
- extra properties for initialization
-
-
Method Details
-
getDataPaths
Get the file paths (or urls or whatever) that are to be changed when we are unpersisted and are in data relative mode- Specified by:
getDataPaths
in interfaceDataSource
- Overrides:
getDataPaths
in classDataSourceImpl
- Returns:
- file paths to changed
-
isFileBased
protected boolean isFileBased()Are we getting data from a file or from server- Returns:
- is the data from files
-
getDataFileExtension
Get the file extension- Parameters:
file
- The file- Returns:
- its extension
-
processDataFilename
Process the file name to get a file that we can use to write to local disk- Parameters:
filename
- Filenameindex
- Which file it it. This can be used by derived classes to add more info to the file name- Returns:
- The processed filename
-
saveDataToLocalDisk
protected List saveDataToLocalDisk(String prefix, Object loadId, boolean changeLinks) throws Exception Save the data source files to local disk- Overrides:
saveDataToLocalDisk
in classDataSourceImpl
- Parameters:
prefix
- The directory prefix and unique file prefixloadId
- For stopping the load through the JobManagerchangeLinks
- Should this data source also change its internal data references- Returns:
- List of the files that were written
- Throws:
Exception
- On badness
-
getInputStreams
Get a list of input streams, one for each given file- Parameters:
processedSources
- The sources- Returns:
- List of input streams
- Throws:
Exception
- On badness
-
initAfterCreation
public void initAfterCreation()Initialize after we have been directly created- Specified by:
initAfterCreation
in interfaceDataSource
- Overrides:
initAfterCreation
in classDataSourceImpl
-
getPartialDescription
Return the human readable description of this DataSource- Specified by:
getPartialDescription
in interfaceDataSource
- Overrides:
getPartialDescription
in classDataSourceImpl
- Returns:
- the description
-
getFullDescription
get the detailed description- Specified by:
getFullDescription
in interfaceDataSource
- Overrides:
getFullDescription
in classDataSourceImpl
- Returns:
- description
-
haveSources
public boolean haveSources()Do I have any sources- Returns:
- Has sources
-
initAfterUnpersistence
public void initAfterUnpersistence()Initialize after XML decoding.- Specified by:
initAfterUnpersistence
in interfaceDataSource
- Overrides:
initAfterUnpersistence
in classDataSourceImpl
-
updateState
This gets called when the user interactively does a Change data- Specified by:
updateState
in interfaceDataSource
- Overrides:
updateState
in classDataSourceImpl
- Parameters:
newObject
- The new data object. May be a string or a listnewProperties
- new properties
-
initWithPollingInfo
protected void initWithPollingInfo()Initialze sources from polling info -
propertiesChanged
protected void propertiesChanged()The user changed the properties. Reinitialize from polling info if we have it- Overrides:
propertiesChanged
in classDataSourceImpl
-
setNewFiles
Used to change the files we use when loaded in from a bundle- Specified by:
setNewFiles
in interfaceDataSource
- Overrides:
setNewFiles
in classDataSourceImpl
- Parameters:
files
- Files to use
-
sourcesChanged
protected void sourcesChanged()Something changed -
reloadData
Description copied from class:DataSourceImpl
Reload data- Specified by:
reloadData
in interfaceDataSource
- Overrides:
reloadData
in classDataSourceImpl
- Parameters:
object
- the objectproperties
- the properties
-
getLocationsForPolling
Get the location where we poll.- Overrides:
getLocationsForPolling
in classDataSourceImpl
- Returns:
- Directory to poll on.
-
newFilesFromPolling
If we are polling some directory this method gets called when there is a new file. We set the file name, clear our state, reload the metadata and tell listeners of the change.- Overrides:
newFilesFromPolling
in classDataSourceImpl
- Parameters:
files
- New files
-
doRemove
public void doRemove()Called when Datasource is removed.- Specified by:
doRemove
in interfaceDataSource
- Overrides:
doRemove
in classDataSourceImpl
-
reloadData
public void reloadData()Clear out and reinitialize the track- Specified by:
reloadData
in interfaceDataSource
- Overrides:
reloadData
in classDataSourceImpl
-
getFilePath
Get the first file path in the sources list- Returns:
- file path
-
setSources
Set the sources property (filename or URL). Used by persistence- Parameters:
value
- data sources
-
getSources
Get the source property (filename or URL). Used by persistence- Returns:
- data source
-
getSource
Get the string value of the first entry in the sources list- Returns:
- The first source
-
setSource
Set the list of sources to be a list containing the given value- Parameters:
value
- value
-
equals
Are we equals- Overrides:
equals
in classDataSourceImpl
- Parameters:
that
- that- Returns:
- is equals
-