Return of the retry.

Change 5ddf6a171337ddf8e1a881e63d1ab9ec4a7042ba removed too much.
There was also buried in deep the "retry if result set is small"
case.
Applied Igor's coment.
NEXUS-5400: Uploaded file trashed by rebuild md

Since Nexus 2.0 a requirement for repositories is that
from their root ("baseDir"), they must reside on _same volume_
(due to attributes). This change that builds upon that,
and introduces repo "tmp" folder. With this change, we do
not put "tmp" files anymore in the folder where they will
reside, but instead into a "/.nexus/tmp" folder under
same hierarchy (parent folders). Due to "one repo on one volume"
requirement, rename will be still cheap, and not cp+rm operation.
Hence, it does not matter is file in same folder (as before)
or other folder, as long rename happens on single volume.

This still does not resolve other problem revealed: locking.
Rebuild md deletes empty folders (more precisely, what it
"thinks" is empty, see Ben's comment on this issue) without
doing any locking, using the "unprotected" API. But, this was
like it since day 0 it seems.
NEXUS-5400: Fixed a bug and enforced UT
Remove remoteStorage provider from IT configurations
Only save the remoteStorage provider if it is not the default
Adapt UT to not expect the provider id in the configuration
NEXUS-5412: Fix and test for "uncollapse" case.

SearchNGIndexPlexusResource detects that result would consist of
less than a threshold (35 by default) of lines, it repeats the search
in "uncollapsed" mode, even if original request had a hint to "collapse"
(Search UI does requests like this). But alas, two of those checks were
made, once good (comparing apples to apples), and once in searchByTerms
method badly (comparing apples to oranges).

UT:
This very method of this UT was totally brain-dead, unsure what it
tested originally, if it did anything useful at all. First, looking at the
parent class, becomes obvious that only apache-snapshots repo
was indexed (implicitly, by URL change!). Second, security was
ON, and as UT thread did not set Subject, every search hit
was been denied by Security (lack of subject).
[NEXUS-5414] Do not process proxy repositories in snapshots removal task

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
NEXUS-5400: Simplifying.

Original "fix" was to put the uploaded file into "tmp" repo folder having
same directory structure as "final" file would have. This is completely
unnecessary!

We not just store the file in the root of repo temp folder (using
File.createTempFile guarantees uniqueness), as it will be moved
into its finale place in equally same "cheap" way as it would be
in it's intended subfolder.
Merge remote-tracking branch 'origin/master' into nexus-5400-uploaded-file-trashed
NEXUS-5400: Modified unrelated IT to be more tolerant for "working files"

This it was eagerly searching for empty directories in all repositories
and it is testing evict tasks, and the fact that emopty folders
are removed from storage after eviction. Sadly, this IT
checks _whole_ structure, including "special" folders like ".meta" and
".nexus" now, as this IT was added way before those folders popped up.

This change now makes this IT to neglect ".nexus/tmp" folder, but
it might be broadened too, since it is interested in empty _artifact_
folders, but not in empty attributes, empty metadata or empty temp
folders.
NEXUS-5400: Adapting UT

To the fact that there is no more directory structure for temp
files. They are stored "flat".
Add UTs
[NXCM-4530] Fix logging in "repository not found" while iterating member of a group

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
Merge pull request #682 from sonatype/nexus-5400-uploaded-file-trashed

NEXUS-5400: Uploaded file trashed by rebuild md
Merge pull request #689 from sonatype/nxcm-4530-fix-logging

[NXCM-4530] Fix logging in "repository not found" while iterating member of a group
Merge pull request #685 from sonatype/nexus-5258-dont-save-default-provider

[NEXUS-5258] Do not save default remote storage provider
Fix license header
Merge pull request #688 from sonatype/nexus-5414-snapshots-remover

[NEXUS-5414] Do not process proxy repositories in snapshots removal task