コード例 #1
0
ファイル: RaobDataSource.java プロジェクト: Unidata/IDV
 /**
  * Override the init method for when this data source is unpersisted. We simply check the
  * imageList to see if this object came from a legacy bundle.
  */
 public void initAfterUnpersistence() {
   super.initAfterUnpersistence();
   List tmp = getTmpPaths();
   if (tmp != null) {
     List obs = getRDS().getSoundingObs();
     AddeSoundingAdapter asa = (AddeSoundingAdapter) getRDS().getSoundingAdapter();
     for (int i = 0; i < tmp.size(); i += 2) {
       SoundingOb ob = (SoundingOb) obs.get(i / 2);
       ob.setMandatoryFile(tmp.get(i).toString());
       ob.setMandatoryFile(tmp.get(i + 1).toString());
     }
   }
 }
コード例 #2
0
ファイル: RaobDataSource.java プロジェクト: Unidata/IDV
 /**
  * _Save the remote data to local disk
  *
  * @param prefix Where to write the files to
  * @param loadId For the JobManager dialog
  * @param changeLinks Should we change the internal data references
  * @return List of files we wrote
  * @throws Exception On badness
  */
 protected List saveDataToLocalDisk(String prefix, Object loadId, boolean changeLinks)
     throws Exception {
   List urls = new ArrayList();
   List obs = getRDS().getSoundingObs();
   AddeSoundingAdapter asa = (AddeSoundingAdapter) getRDS().getSoundingAdapter();
   for (int i = 0; i < obs.size(); i++) {
     SoundingOb ob = (SoundingOb) obs.get(i);
     urls.add(asa.getMandatoryURL(ob) + "&rawstream=true");
     urls.add(asa.getSigURL(ob) + "&rawstream=true");
   }
   List newFiles = IOUtil.writeTo(urls, prefix, "raob", loadId);
   if (newFiles == null) {
     return null;
   }
   if (changeLinks) {
     for (int i = 0; i < newFiles.size(); i += 2) {
       SoundingOb ob = (SoundingOb) obs.get(i / 2);
       ob.setMandatoryFile(newFiles.get(i).toString());
       ob.setSigFile(newFiles.get(i + 1).toString());
     }
   }
   return newFiles;
 }