* @throws IOException if the operation failed.
*/
public static String generateAppArchiveForTenant(String source, HttpSession session,
String propertyFile)
throws IOException {
SuperTenantCarbonContext carbonContext =
SuperTenantCarbonContext.getCurrentContext();
int tenantId = carbonContext.getTenantId();
if (tenantId <= 0) {
return source;
}
String tenantDomain = carbonContext.getTenantDomain(true);
String username = carbonContext.getUsername();
File tempDir = File.createTempFile(TENANT_APP_TEMP_DIRECTORY_PATH, "");
File tempFile = File.createTempFile(TENANT_APP_TEMP_FILE_PATH, "");
String dir = tempDir.getAbsolutePath();
String destination = tempFile.getAbsolutePath() +
source.substring(source.lastIndexOf(File.separator));