Skip to main content
Solved

OneDriveConnector not rejecting invalid Download Location

  • January 8, 2021
  • 6 replies
  • 47 views

sameer
Contributor
Forum|alt.badge.img+18

Hello & Happy New Year

 

Whilst testing this transformer I realised that if I set it to:

  • Download "As File"
  • Download To Folder "Intentionally set to wrong location"

 

OneDrive-Connector 

Then the invalid setting is not rejected nor the cog changing its colour to red.

Is this by design?

 

If I, of course, amend the ObjectID then the feature will be rejected.

I also set the target folder (wrong location) as an attribute and same result

 

Thanks

Sameer

Best answer by chrisatsafe

Hi @chrisatsafe​ 

 

If "Download to Folder" is set for instance to "E:\\FME Workbench\\JWS\\Abc\\", knowing that "Abc" folder does not exist then that folder is automatically created which I do not want as well as the file being downloaded to that new location.

 

A path that does not exists is not invalid in FME's eyes. Workbench isn't checking for existing paths and has the ability to create folders for this reason; this makes fanouts possible.

 

The only reason you'd see features being rejected would be if you were trying to write to a non existent drive as FME will not create drive partitions.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • 606 replies
  • January 12, 2021

Hi @sameer​ ,

 

Setting the download to folder using an attribute value makes the OneDriveConnector parameters valid. If you had an invalid path as one of the "DownloadLocation" attribute values, I'd expect the OneDriveConnector to send that feature to the rejected port. Are you able to confirm whether the file will still download or if it is rejected?


sameer
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • 63 replies
  • January 12, 2021

Hi @sameer​ ,

 

Setting the download to folder using an attribute value makes the OneDriveConnector parameters valid. If you had an invalid path as one of the "DownloadLocation" attribute values, I'd expect the OneDriveConnector to send that feature to the rejected port. Are you able to confirm whether the file will still download or if it is rejected?

Hi @chrisatsafe​ 

 

If "Download to Folder" is set for instance to "E:\\FME Workbench\\JWS\\Abc\\", knowing that "Abc" folder does not exist then that folder is automatically created which I do not want as well as the file being downloaded to that new location.

 


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • 606 replies
  • January 12, 2021

Hi @chrisatsafe​ 

 

If "Download to Folder" is set for instance to "E:\\FME Workbench\\JWS\\Abc\\", knowing that "Abc" folder does not exist then that folder is automatically created which I do not want as well as the file being downloaded to that new location.

 

I see, it sounds like you're going to need to check if that directory exists before passing the downloadlocation attribute value into the OneDriveConnector.

 

You can check with a FeatureReader before the OneDriveConnector by setting the format to Directory and File Pathnames and the dataset to the downloadlocation attribute.

2021-01-12_10-34-05Next, connect the Initiator port to the OneDriveConnector - anything that comes out of the initiator port indicates that the path exists, anything that comes out of the rejected port indicates that the path does not exist. At this point, if you still want to download the rejected features, you could change the path value of the downloadlocation attribute using an attributemanager/other.


sameer
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • 63 replies
  • January 13, 2021

Hi @chrisatsafe​ 

 

If "Download to Folder" is set for instance to "E:\\FME Workbench\\JWS\\Abc\\", knowing that "Abc" folder does not exist then that folder is automatically created which I do not want as well as the file being downloaded to that new location.

 

That's exactly what I've done already to overcome this problem.

OneDrive-FeatureReaderJust want to know why the transformer would not reject:

 

1) An invalid download location

2) Create the folder instead if it does not exist

 


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • 606 replies
  • Best Answer
  • January 13, 2021

Hi @chrisatsafe​ 

 

If "Download to Folder" is set for instance to "E:\\FME Workbench\\JWS\\Abc\\", knowing that "Abc" folder does not exist then that folder is automatically created which I do not want as well as the file being downloaded to that new location.

 

A path that does not exists is not invalid in FME's eyes. Workbench isn't checking for existing paths and has the ability to create folders for this reason; this makes fanouts possible.

 

The only reason you'd see features being rejected would be if you were trying to write to a non existent drive as FME will not create drive partitions.


sameer
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • 63 replies
  • January 14, 2021

Hi @chrisatsafe​ 

 

If "Download to Folder" is set for instance to "E:\\FME Workbench\\JWS\\Abc\\", knowing that "Abc" folder does not exist then that folder is automatically created which I do not want as well as the file being downloaded to that new location.

 

I'll bear this in mind as the transformer is doing this by design.

Thanks for your help.