Bitmagasinet

Pokkers! Den havde jeg glemt. Gone now

Pokkers! Den havde jeg glemt. Gone now

Måske fjern den udkommenterede del?

Måske fjern den udkommenterede del?

Fair nok. Var bare ikke klar over, at vi var begyndt at bruge den notation.

Fair nok.
Var bare ikke klar over, at vi var begyndt at bruge den notation.

Vi gør god brug af 'diamond' notationen rundt omkring. Typen står jo allerede der hvor variablen er erklæret (se linje 82). Finder du det svært at læse?

Vi gør god brug af 'diamond' notationen rundt omkring. Typen står jo allerede der hvor variablen er erklæret (se linje 82). Finder du det svært at læse?

Ikke nogen type på hash-settet? allowedOperationPermissions = new HashSet<OperationPermission>();

Ikke nogen type på hash-settet?

allowedOperationPermissions = new HashSet<OperationPermission>();
BITMAG-1136 Change permission checking to take collectionID into account when authorizing an...
BITMAG-1136 Change permission checking to take collectionID into account when authorizing an...
SettingsUtils is used non-statically.
SettingsUtils is used non-statically.
It seems nice, but all the file-ids it finds starts with the relative path to the folderDir. Thus a FileID = folder1/folder2/file1 will be retrieved as CollectionID/folderDir/folder1/folder2/file1 ...

It seems nice, but all the file-ids it finds starts with the relative path to the folderDir.
Thus a FileID = folder1/folder2/file1
will be retrieved as CollectionID/folderDir/folder1/folder2/file1

This must be an optimization for another day

agreed

agreed

Exactly! But that was not indended. I'll fixed it.

Exactly!
But that was not indended.
I'll fixed it.

Ahh.. Of course. Forgot about the 'validateFileToCacheConsistency...'

Ahh.. Of course. Forgot about the 'validateFileToCacheConsistency...'

ok

ok

Ok, I'll throw an exception here, if it fails

Ok, I'll throw an exception here, if it fails

Where: https://docs.oracle.com/javase/8/docs/api/java/io/File.html#delete-- It might throw an SecurityException, but that's runtime Sure, if we were using the static delete method in the Files uti...

Where:
https://docs.oracle.com/javase/8/docs/api/java/io/File.html#delete--
It might throw an SecurityException, but that's runtime

Sure, if we were using the static delete method in the Files utility class, then it might throw an IOException, but we are using the delete method on the File object itself.

Har kigget lidt nærmere på det, og vi behøver slet ikke have collection-id med. Der er ingen grund til at den skal være indlejret i vores exception, da den kun bruges et sted, hvor vi nemt kan skaf...

Har kigget lidt nærmere på det, og vi behøver slet ikke have collection-id med.
Der er ingen grund til at den skal være indlejret i vores exception, da den kun bruges et sted, hvor vi nemt kan skaffe den på en bedre måde.

Jeg tilføjer requesten til loggen i den try-catch, hvor exception'en fanges.

Ja, jeg opdatere det system regex til dit eksempel

Ja, jeg opdatere det system regex til dit eksempel

Ah, ja. Det skal selvfølgelig kun være '..', når det er i form '../' eller '/..' Det retter jeg

Ah, ja. Det skal selvfølgelig kun være '..', når det er i form '../' eller '/..'
Det retter jeg

ok, now I get it. I'll make that case https://sbforge.org/fisheye/static/nhcjlc/2static/images/wiki/icons/emoticons/smile.gif

ok, now I get it.
I'll make that case

agreed

agreed

Okay, I see that you already checked the FileIDFormat in the one user of this method. As to how this can trigger a checksum recalc, let me illustrate: getPillarModel().verifyFileExists(me...

Okay, I see that you already checked the FileIDFormat in the one user of this method.

As to how this can trigger a checksum recalc, let me illustrate:

        getPillarModel().verifyFileExists(message.getFileID(), message.getCollectionID());
calls
FileStorageModel.verifyFileExists
which calls
StorageModel.hasFileID
which calls
FileStorageModel.verifyFileToCacheConsistencyIfRequired
which calls
FileStorageModel.recalculateChecksum
which calls
...

Need I go on?

Just check rootDir==null initially

Just check rootDir==null initially

This method have all of one user, and he always sends "" as the second param. Consider not having a second param

This method have all of one user, and he always sends "" as the second param. Consider not having a second param

Files.walkFileTree(dir.toPath(), new SimpleFileVisitor<Path>(){ @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { r...

        Files.walkFileTree(dir.toPath(), new SimpleFileVisitor<Path>(){
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
                res.add(dirPath+file);
                return FileVisitResult.CONTINUE;
            }
        });
call it createOrGet

call it createOrGet

Fine, call it getOrCreateDirectory. Or getDirectoryFor(retainFile) so you do not have to remember to pass in the parent file.

Fine, call it getOrCreateDirectory. Or getDirectoryFor(retainFile) so you do not have to remember to pass in the parent file.