Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cygnus: Check special characters for filenames #9

Closed
fgalan opened this issue Mar 11, 2014 · 4 comments
Closed

Cygnus: Check special characters for filenames #9

fgalan opened this issue Mar 11, 2014 · 4 comments
Assignees
Milestone

Comments

@fgalan
Copy link
Member

fgalan commented Mar 11, 2014

Moved from telefonicaid/fiware-livedemoapp#15:

As experienced with FINESCE people, if an entity or attribute name or type contains the "/" character then the persisted file for this entity-attribute pair will contain the "/" character. When creating thar file, WebHDFS/HttpFS understands a subdirectory must be created and then a file.

E.g. entity=mycar, entity_tpe=car, attribute_name=speed, attribute_type=km/h will be persisted as mycar-car-speed-km/h.txt, which in the end is the following directory /user/myuser/mystorage/mycar-car-speed-km containing a h.txt file.

Special characters usage must be checked before creating the file name.

@fgalan
Copy link
Member Author

fgalan commented Mar 11, 2014

I think to remember that we had some similar issue with other special character in the past, such ":", that gets replaced by _. Probably it is just a matter of including "/" to the list of special characters to check and replace by _.

@frbattid
Copy link
Member

frbattid commented May 6, 2014

You are right, the characters ':' and '-' are currently replaced by '_'. I would extend the list to any non alphanumeric character, I think using regular expressions this is quite easy:

s = s.replaceAll("[^a-zA-Z0-9]", "_");

@fgalan fgalan changed the title Cygnus: Check special characters in entity and attribute names or types Cygnus: Check special characters for filenames May 7, 2014
@frbattid
Copy link
Member

frbattid commented May 7, 2014

As being discussed by Skype, this is a very different thing than serializing the entity and attribute type and id/name. In this case, we must ensure the serialized characters don't break the Json parsing.

@frbattid frbattid mentioned this issue May 7, 2014
@frbattid
Copy link
Member

frbattid commented May 7, 2014

Solved in PR telefonicaid/fiware-connectors#44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants