tomdesair / tus-java-server

Library to receive tus v1.0.0 file uploads in a Java server environment
MIT License
133 stars 62 forks source link

Exception if cleanup called before any request handled #39

Open OverDrone opened 3 years ago

OverDrone commented 3 years ago

TusFileUploadService.cleanup() calls DiskStorageService.cleanupExpiredUploads(...) and DiskLockingService.cleanupStaleLocks() Those methods throw "directory does not exist" exception if not a single upload was processed, because private method AbstractDiskBasedService.init() was never called.

How to fix:

Call AbstractDiskBasedService.init() inside DiskStorageService.cleanupExpiredUploads(...) and DiskLockingService.cleanupStaleLocks()