Skip to content

Commit

Permalink
Merge pull request #733 from ViniciusCampanha/alpha5
Browse files Browse the repository at this point in the history
Missing folder argument in GrADS accessor
  • Loading branch information
janosimas authored Nov 18, 2016
2 parents 1c06d2f + a5a53a0 commit e1e8df2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/terrama2/impl/DataAccessorFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ std::string terrama2::core::DataAccessorFile::retrieveData(const DataRetrieverPt

try
{
folderPath = getProperty(dataset, dataSeries_, "folder", false);
folderPath = getFolderMask(dataset);
}
catch(UndefinedTagException& /*e*/)
{
Expand Down
15 changes: 13 additions & 2 deletions src/terrama2/impl/DataAccessorGrADS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,19 @@ std::string terrama2::core::DataAccessorGrADS::retrieveData(const DataRetrieverP
const Filter& filter,
std::shared_ptr<FileRemover> remover) const
{
std::string folderPath = "";

try
{
folderPath = getFolderMask(dataset);
}
catch(UndefinedTagException& /*e*/)
{
// Do nothing
}

std::string mask = getCtlFilename(dataset);
std::string uri = dataRetriever->retrieveData(mask, filter, remover);
std::string uri = dataRetriever->retrieveData(mask, filter, remover, "", folderPath);

QUrl url(QString::fromStdString(uri));
QDir dir(url.path());
Expand All @@ -118,7 +129,7 @@ std::string terrama2::core::DataAccessorGrADS::retrieveData(const DataRetrieverP

datasetMask = grad2TerramaMask(datasetMask.c_str()).toStdString();

dataRetriever->retrieveData(datasetMask, filter, remover, uri);
dataRetriever->retrieveData(datasetMask, filter, remover, uri, folderPath);
}

return uri;
Expand Down
3 changes: 2 additions & 1 deletion src/terrama2/impl/DataAccessorGrADS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ namespace terrama2
\return The URI to retrieved data.
*/
std::string
retrieveData(const DataRetrieverPtr dataRetriever, DataSetPtr dataSet, const Filter& filter, std::shared_ptr<FileRemover> remover) const override;
retrieveData(const DataRetrieverPtr dataRetriever, DataSetPtr dataSet, const Filter& filter,
std::shared_ptr<FileRemover> remover) const override;

/*
\brief Returns a smart pointer to a DataAccessorGrADS.
Expand Down

0 comments on commit e1e8df2

Please sign in to comment.