Skip to content

Commit

Permalink
CB-5609. Refactor after review
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisSinelnikov committed Dec 26, 2024
1 parent 7ec638d commit 97a6704
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
public class WebServiceFS implements DBWServiceFS {

public static final String FORBIDDEN_FILENAME_REGEX = "[%#:;№_$]";
private static final Pattern FORBIDDEN_FILENAME_PATTERN = Pattern.compile("[%#:;№_$]");

@NotNull
@Override
Expand Down Expand Up @@ -282,12 +282,11 @@ public boolean deleteFile(
}
}

private static void validateFilename(String filename) throws DBWebException {
Pattern pattern = Pattern.compile(FORBIDDEN_FILENAME_REGEX);
Matcher matcher = pattern.matcher(filename);
public void validateFilename(String filename) throws DBWebException {

Check warning on line 285 in server/bundles/io.cloudbeaver.service.fs/src/io/cloudbeaver/service/fs/impl/WebServiceFS.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.service.fs/src/io/cloudbeaver/service/fs/impl/WebServiceFS.java:285:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

Check warning on line 285 in server/bundles/io.cloudbeaver.service.fs/src/io/cloudbeaver/service/fs/impl/WebServiceFS.java

View check run for this annotation

Jenkins-CI-integration / CheckStyle Java Report

server/bundles/io.cloudbeaver.service.fs/src/io/cloudbeaver/service/fs/impl/WebServiceFS.java#L285

Missing a Javadoc comment.
Matcher matcher = FORBIDDEN_FILENAME_PATTERN.matcher(filename);

if (matcher.find()) {
throw new DBWebException("File include forbidden symbols: " + filename);
throw new DBWebException("File includes forbidden symbols: " + filename);
}
}
}

0 comments on commit 97a6704

Please sign in to comment.