Hi,
you could use following code to deploy it directly assuming that process engine is already configured:
NewDeployment deployment = repositoryService.createDeployment();
deployment.setName(processFile.getName());
deployment.setTimestamp(System.currentTimeMillis());
if (processFile.getName().endsWith(".xml")) {
deployment.addResourceFromFile(processFile);
} else if (processFile.getName().endsWith("ar")) {
FileInputStream fileInputStream = new FileInputStream(processFile);
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
deployment.addResourcesFromZipInputStream(zipInputStream);
}
Where processFile is File instance representing your process.
HTH
Maciej