boolean isInMemory = item.isInMemory();
long sizeInBytes = item.getSize();
if(fieldName.equalsIgnoreCase("deploymentDescriptor")) return null;
RuntimeRepository runtimeRepository = TalendEngine.getRuntimeRepository();
File jobsDir = new File(runtimeRepository.getRootDir(), jobDeploymentDescriptor.getLanguage().toLowerCase());
File projectDir = new File(jobsDir, jobDeploymentDescriptor.getProject());
File tmpDir = new File(projectDir, "tmp");
if(!tmpDir.exists()) tmpDir.mkdirs();
File uploadedFile = new File(tmpDir, fileName);
try {
item.write(uploadedFile);
} catch (Exception e) {
e.printStackTrace();
}
String[] dirNames = ZipUtils.getDirectoryNameByLevel(new ZipFile(uploadedFile), 2);
List dirNameList = new ArrayList();
for(int i = 0; i < dirNames.length; i++) {
if(!dirNames[i].equalsIgnoreCase("lib")) dirNameList.add(dirNames[i]);
}
String[] jobNames = (String[])dirNameList.toArray(new String[0]);
runtimeRepository.deployJob(jobDeploymentDescriptor, new ZipFile(uploadedFile));
uploadedFile.delete();
tmpDir.delete();
return jobNames;
}