| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.SettingData; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | |
| | | private final static String UNKNOWN = "unknown"; |
| | | |
| | | private final static String COMMA = ","; |
| | | |
| | | private final static Log log = LogFactory.getLog(WebHelper.class); |
| | | |
| | | /** |
| | | * 获取GUID |
| | |
| | | } |
| | | |
| | | /** |
| | | * 写响应信息 |
| | | */ |
| | | public static void writeInfo(HttpStatus status, String info, HttpServletResponse res) { |
| | | try { |
| | | WebHelper.write2Page(res, WebHelper.getErrJson(status, info)); |
| | | } catch (Exception e) { |
| | | // |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取随机整数 |
| | | */ |
| | | public static int getRandomInt(int min, int max) { |
| | |
| | | outputStream.close(); |
| | | fileInputStream.close(); |
| | | } |
| | | |
| | | /** |
| | | * 执行命令 |
| | | * |
| | | * @param cmd 命令 |
| | | */ |
| | | public static void exec(String cmd) { |
| | | try { |
| | | Runtime.getRuntime().exec(cmd); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |