@Override
public void uploadApplication(String appName, File file, UploadStatusCallback callback) throws IOException {
Assert.notNull(file, "File must not be null");
if (file.isDirectory()) {
ApplicationArchive archive = new DirectoryApplicationArchive(file);
uploadApplication(appName, archive, callback);
} else {
ZipFile zipFile = new ZipFile(file);
try {
ApplicationArchive archive = new ZipApplicationArchive(zipFile);
uploadApplication(appName, archive, callback);
} finally {
zipFile.close();
}
}