Skip to content

Remove encoding from file download and beautify code#888

Merged
tomas-sexenian merged 5 commits into
masterfrom
RemoveEncoding
Aug 21, 2024
Merged

Remove encoding from file download and beautify code#888
tomas-sexenian merged 5 commits into
masterfrom
RemoveEncoding

Conversation

@tomas-sexenian

Copy link
Copy Markdown
Contributor

No description provided.

@tomas-sexenian tomas-sexenian requested a review from iroqueta August 5, 2024 13:41
@tomas-sexenian

Copy link
Copy Markdown
Contributor Author

Issue: 200333

.replace(">", "_")
.replace("|", "_")
.replace("\n", "_")
.replace("\r", "_");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if you use Pattern to replace file name, like this:

private static final String FILE_INVALID_CHARS = "[\\/:*?"<>|\n\r]";
private static final Pattern FILE_INVALID_PATTERN = Pattern.compile(FILE_INVALID_CHARS);
filename = FILE_INVALID_PATTERN.matcher(filename).replaceAll("_");

@tomas-sexenian tomas-sexenian merged commit 1364c70 into master Aug 21, 2024
@tomas-sexenian tomas-sexenian deleted the RemoveEncoding branch August 21, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants