public Optional<String> getApplicationPackageReference(ApplicationId applicationId) {
        Optional<String> applicationPackage = Optional.empty();
        Optional<Session> session = getActiveSession(applicationId);
        if (session.isPresent()) {
            Optional<FileReference> applicationPackageReference = session.get().getApplicationPackageReference();
            File downloadDirectory = new File(Defaults.getDefaults().underVespaHome(configserverConfig().fileReferencesDir()));
            if (applicationPackageReference.isPresent() && ! fileReferenceExistsOnDisk(downloadDirectory, applicationPackageReference.get()))
                applicationPackage = Optional.of(applicationPackageReference.get().value());
        }
        return applicationPackage;
    }
Deletes an application and associated resources

@return true if the application was found and deleted, false if it was not present
@throws RuntimeException if deleting the application fails. This method is exception safe.
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java