If I got you right, maybe less error-prone (at least more definite) should be iteratively removing last after-dot part and testing with ```isDirectory```? I mean, if there are two directories with versions in their names, like ```name.1.0``` and ```name.1.1```, you aren't completely sure where you aim with ```*```. And since this isn't the bottleneck of computation, we can afford to check (at most 3-5 times, I suppose) ```name.1.1.tar.gz```, then - ```name.1.1.tar```, then, finally, ```name.1.1```.