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 ListList of sources filesprotected Stringfor unpersistenceprotected ListList of sources filesFields inherited from class ucar.unidata.data.DataSourceImpl
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YESFields 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 TypeMethodDescriptionvoiddoRemove()Called when Datasource is removed.booleanAre we equalsprotected StringgetDataFileExtension(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 StringGet the first file path in the sources listget the detailed descriptionprotected ListgetInputStreams(List processedSources) Get a list of input streams, one for each given fileprotected ListGet the location where we poll.Return the human readable description of this DataSourceprotected StringGet the string value of the first entry in the sources listGet the source property (filename or URL).booleanDo I have any sourcesvoidInitialize after we have been directly createdvoidInitialize after XML decoding.protected voidInitialze sources from polling infoprotected booleanAre we getting data from a file or from servervoidnewFilesFromPolling(List files) If we are polling some directory this method gets called when there is a new file.protected StringprocessDataFilename(String filename, int index) Process the file name to get a file that we can use to write to local diskprotected voidThe user changed the properties.voidClear out and reinitialize the trackvoidreloadData(Object object, Hashtable properties) Reload dataprotected ListsaveDataToLocalDisk(String prefix, Object loadId, boolean changeLinks) Save the data source files to local diskvoidsetNewFiles(List files) Used to change the files we use when loaded in from a bundlevoidSet the list of sources to be a list containing the given valuevoidsetSources(List value) Set the sources property (filename or URL).protected voidSomething changedvoidupdateState(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, writeFieldMaskFileMethods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialogMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getDataPathsin interfaceDataSource- Overrides:
getDataPathsin 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:
saveDataToLocalDiskin 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:
initAfterCreationin interfaceDataSource- Overrides:
initAfterCreationin classDataSourceImpl
-
getPartialDescription
Return the human readable description of this DataSource- Specified by:
getPartialDescriptionin interfaceDataSource- Overrides:
getPartialDescriptionin classDataSourceImpl- Returns:
- the description
-
getFullDescription
get the detailed description- Specified by:
getFullDescriptionin interfaceDataSource- Overrides:
getFullDescriptionin 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:
initAfterUnpersistencein interfaceDataSource- Overrides:
initAfterUnpersistencein classDataSourceImpl
-
updateState
This gets called when the user interactively does a Change data- Specified by:
updateStatein interfaceDataSource- Overrides:
updateStatein 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:
propertiesChangedin classDataSourceImpl
-
setNewFiles
Used to change the files we use when loaded in from a bundle- Specified by:
setNewFilesin interfaceDataSource- Overrides:
setNewFilesin classDataSourceImpl- Parameters:
files- Files to use
-
sourcesChanged
protected void sourcesChanged()Something changed -
reloadData
Description copied from class:DataSourceImplReload data- Specified by:
reloadDatain interfaceDataSource- Overrides:
reloadDatain classDataSourceImpl- Parameters:
object- the objectproperties- the properties
-
getLocationsForPolling
Get the location where we poll.- Overrides:
getLocationsForPollingin 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:
newFilesFromPollingin classDataSourceImpl- Parameters:
files- New files
-
doRemove
public void doRemove()Called when Datasource is removed.- Specified by:
doRemovein interfaceDataSource- Overrides:
doRemovein classDataSourceImpl
-
reloadData
public void reloadData()Clear out and reinitialize the track- Specified by:
reloadDatain interfaceDataSource- Overrides:
reloadDatain 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:
equalsin classDataSourceImpl- Parameters:
that- that- Returns:
- is equals
-