I'm developing a java program that will read a file, for example; PSD file (example.psd), and I'll edit the bytes of the file. How can I call the adobe software and have it read the edited bytes through the java program without having to write out the file?
package sandbox;
import java.io.IOException;
public class Sandbox {
/**
* Example of how to run an executable from Java.
*
* @param args
*/
public static String readFileAsString(String fileName)throws Exception
{
String data = "";
data = new String(Files.readAllBytes(Paths.get(fileName)));
return data;
}
public static void main(String[] args) {
try {
Runtime runTime = Runtime.getRuntime();
String data = readFileAsString("C:\\Users\\pankaj\\Desktop\\example.psd");
String executablePath = "C:\\Users\\sdkca\\AppData\\Local\\Programs\\Adobe\\Adobe.exe";
Process process = runTime.exec(executablePath);
} catch (IOException e) {
e.printStackTrace();
}
}
}
I can call the adobe, and also read the bytes, how would I tell the adobe to read the bytes?