1.第一种方式
public static void convertFlv(final String sourceFile,
final String tagetFile, final String kbps, final String ffmpegHomePath)throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
StringBuffer command = new StringBuffer();
Process process = Runtime.getRuntime().exec(
command.toString());
int i = process.waitFor();
if (i == 0) {
/*
* Msg msg = smbPut(tagetFile); if(!msg.isB()){ throw
* new Exception(msg.getDesc()); }
*/
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
thread.start();
}
2.第二中方式 synchronized
public String login(@QueryParam("ticket")String ticket) {
try{
boolean isRepeatRequest=false;
synchronized (Constants.TICKET_MAP) {
}else{
Constants.TICKET_MAP.put(ticket,System.currentTimeMillis());
}
}
}
1027

被折叠的 条评论
为什么被折叠?



