2424import java .nio .file .attribute .BasicFileAttributes ;
2525import java .util .Set ;
2626import java .util .function .Consumer ;
27- import java .util .regex .Pattern ;
2827
2928import static java .nio .charset .StandardCharsets .UTF_8 ;
3029import static org .cryptomator .cryptofs .common .Constants .DEFLATED_FILE_SUFFIX ;
@@ -38,7 +37,6 @@ public class ShortenedNamesCheck implements HealthCheck {
3837 private static final Logger LOG = LoggerFactory .getLogger (ShortenedNamesCheck .class );
3938 private static final int MAX_TRAVERSAL_DEPTH = 3 ;
4039 private static final BaseEncoding BASE64URL = BaseEncoding .base64Url ();
41- private static final Pattern NULL_BYTES = Pattern .compile ("\0 +" );
4240
4341 @ Override
4442 public String name () {
@@ -91,7 +89,7 @@ void checkShortenedName(Path dir) throws IOException {
9189 if (!attrs .isRegularFile ()) {
9290 resultCollector .accept (new MissingLongName (dir ));
9391 return ;
94- } else if (attrs .size () > LongFileNameProvider .MAX_FILENAME_BUFFER_SIZE ) { //TODO: should be revised
92+ } else if (attrs .size () > LongFileNameProvider .MAX_FILENAME_BUFFER_SIZE ) {
9593 resultCollector .accept (new ObeseNameFile (nameFile , attrs .size ()));
9694 return ;
9795 }
@@ -125,16 +123,16 @@ void checkShortenedName(Path dir) throws IOException {
125123 */
126124 SyntaxResult checkSyntax (String toAnalyse ) {
127125 int posObligatoryC9rString = toAnalyse .indexOf (Constants .CRYPTOMATOR_FILE_SUFFIX );
128- if (posObligatoryC9rString == -1 ) {
126+ if (posObligatoryC9rString == -1 ) {
129127 return SyntaxResult .INVALID ;
130128 }
131129
132130 var encryptedFileName = toAnalyse .substring (0 , posObligatoryC9rString );
133- if (!BASE64URL .canDecode (encryptedFileName )) {
131+ if (!BASE64URL .canDecode (encryptedFileName )) {
134132 return SyntaxResult .INVALID ;
135133 }
136134
137- if (toAnalyse .substring (posObligatoryC9rString ).length () > Constants .CRYPTOMATOR_FILE_SUFFIX .length () ) {
135+ if (toAnalyse .substring (posObligatoryC9rString ).length () > Constants .CRYPTOMATOR_FILE_SUFFIX .length ()) {
138136 return SyntaxResult .TRAILING_BYTES ;
139137 }
140138
0 commit comments