Package com.isfasiel.util.data

Examples of com.isfasiel.util.data.Data


   * @throws Exception
   */
  @RequestMapping(value="/file/download/{fileId}")
  public void downloadFile(@PathVariable("fileId") Long fileId, HttpServletResponse response) throws Exception {
    //String realPath = request.getSession().getServletContext().getRealPath("/")+ basePath;
    Data param = new Data();
    param.add("fileId", fileId);
    String ids = param.getString("fileId");
    ids = ids.replaceAll("\r", "");
    ids = ids.replaceAll("\n", "");
    if (ids.contains(";")) {
      ids = ids.substring(0, ids.indexOf(";"));
    }
    param.add("fileId", Integer.parseInt(ids));
   
    Data result = fileService.getFile(param);
    fileUtil.downloadFile(response,
        request,
        result.getString("dirType") + "/" + result.getString("phyPath"),
        result.getString("phyName"),
        result.getString("fileName"));
   
  }
View Full Code Here


    return "file/imageWeb";
  }
 
  @RequestMapping(value="/file/mov/{fileId}")
  public void downloadForMov(@PathVariable("fileId") Long fileId, HttpServletResponse response) throws Exception {
    Data param = new Data();
    param.add("fileId", fileId);
    String ids = param.getString("fileId");
    ids = ids.replaceAll("\r", "");
    ids = ids.replaceAll("\n", "");
    if (ids.contains(";")) {
      ids = ids.substring(0, ids.indexOf(";"));
    }
    param.add("fileId", Integer.parseInt(ids));
   
    Data result = fileService.getFile(param);
    String dest = fileUtil.copyFileToWebServer(getContextPath("/tempFile/"),
                result.getString("dirType") + "/" + result.getString("phyPath"),
                result.getString("phyName"));
   
    result = null;
    param = null;
    response.sendRedirect(dest);
  }
View Full Code Here

   * @param realPath
   * @return
   * @throws Exception
   */
  protected void setDirInfo(String type) throws Exception{
    Data dir = new Data();
    if(dirUtil.getDirId() == -1) {
      dir.add(0, "phyPath", dateUtil.dateToPath());
      dir.add(0, "dirType", type);
      dir = dirService.insertDir(getBasePath(), dir);
      dirUtil.setDirId(dir.getLong(0, "dirId"));
      dirUtil.setPhyPath(dir.getString(0, "phyPath"));
      dirUtil.setDirType(dir.getString(0, "dirType"));
    }
    dir = null;
  }
View Full Code Here

   */
  @RequestMapping(value="/file/upload.do")
  public String uploadFiles(HttpServletRequest request, Model model) throws Exception {
    setDirInfo("N");
   
    Data files =  fileUtil.uploadFilesrequest,
                      dirUtil.getDirType() + "/" + dirUtil.getPhyPath(),
                      dirUtil.getDirId()
                    );
   
    int size = files.size();
   
    for(int i =0; i < size; i++) {
      files.add(i, "fileType", "A");
    }
    files = fileService.insertFile(files);
   
    Data param = new Data();
    for(int i = 0; i< size; i++) {
      param.add(i, "fileId", files.getString(i, "fileId"));
      param.add(i, "fileName", files.getString(i, "fileName"));
    }
    files = null;
    addJavaScript(model, "fileList", param);
   
    return "file/upload";
View Full Code Here

      return true;
    }
  }
   
  protected Data getParam() throws Exception{
    return new Data(request) ;
  }
View Full Code Here

  protected Data getParam() throws Exception{
    return new Data(request) ;
  }
 
  protected Data getParam(HttpServletRequest request) throws Exception {
    return new Data(request);
  }
View Full Code Here

   */
  protected void linkFileMap(Data param, long contentId) throws Exception{
    int size = param.size();
   
    int index =0;
    Data fileParam = new Data();
    for(int i =0; i < size; i++) {
      if( param.get(i, "fileId") != null) {
        fileParam.add(index, "contentId", contentId);
        fileParam.add(index, "fileId", param.get(i, "fileId"));
        index++;
      }
    }
    if( fileParam.size() == 0) {
      return;
    }
    fileService.insertFileMap(fileParam);
  }
View Full Code Here

   * @param request
   * @return
   * @throws Exception
   */
  protected Object getFileList(long contentId) throws Exception{
    Data param = new Data();
    param.add("contentId", contentId);
    return fileService.getFileList(param);
  }
View Full Code Here

  protected String getRemoteIP(HttpServletRequest request) {
    return request.getRemoteAddr();
  }
 
  protected String returnErrorMsg(Model model, String msg) {
    Data result = new Data();
    result.add(0, "result", msg);
    addXML(model, "result", result, "msg");
    return basePath;
  }
View Full Code Here

    addXML(model, "result", result, "msg");
    return basePath;
  }
 
  protected String returnOkMsg(Model model) {
    Data result = new Data();
    result.add(0, "result", "OK");
    addXML(model, "result", result, "msg");
    return basePath;
  }
View Full Code Here

TOP

Related Classes of com.isfasiel.util.data.Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.