-
Notifications
You must be signed in to change notification settings - Fork 0
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
Skip registration for files and ignore files with insufficient rights #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
One question about the directory check
private List<RegistrationRequest> createRequests(File[] files, Path userDirectory) { | ||
if (files == null || files.length == 0) { | ||
return new ArrayList<>(); | ||
} | ||
return Arrays.stream(files).filter(file -> !file.isHidden()) | ||
return Arrays.stream(files).filter(file -> !file.isHidden()).filter(File::isDirectory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that the filtering for directories should take place earlier. In the detectDataForRegistration
there is a variable userProcessDirectories
containing both files that are and file that are not directories?
Why is the check in line 74 not sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
I added another filter method and apply all filters before the createRequest
method, since it violates the definition of a function.
…m:qbicsoftware/data-processing into fix/registration-data-must-be-a-directory
if (file.isHidden()) { | ||
return false; | ||
} | ||
return !file.isFile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return !file.isFile(); | |
return file.isDirectory(); |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Currently the registration fails silently if the dataset to register
is not wrapped in a directory.
Also, the dataset registration fails, when the application has not sufficient rights to execute and write to the dataset folder (e.g. wrong access group, etc).