Changeset 2573


Ignore:
Timestamp:
Aug 14, 2014, 8:54:42 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #595: Confirm alignment

Changes related to [2566] due to paths now being stored with a starting '/'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/OpenGridServlet.java

    r2420 r2573  
    123123        String projectRoot = cluster.getRequiredConfig("project-archive");
    124124       
    125         String f = "find \"" + projectRoot+ "/" + path + "\" -name \"*\" -type f -printf \"%d\\t%P\\t%s\\n\" | sort";
     125        String f = "find \"" + projectRoot+ path + "\" -name \"*\" -type f -printf \"%d\\t%P\\t%s\\n\" | sort";
    126126        CmdResult find = cluster.executeCmd(f, 10);
    127127        if (find.getExitStatus() == 0)
     
    202202       
    203203        ssh = cluster.connect(1);
    204         cluster.downloadFile(ssh, projectRoot + "/" + path, new ServletResponseDestFile(resp));
     204        cluster.downloadFile(ssh, projectRoot + path, new ServletResponseDestFile(resp));
    205205      }
    206206     
     
    307307       
    308308        Job job = Job.getNew(dc, null, null, null);
    309         String from = cluster.getId()+":"+projectRoot + "/" + path;
     309        String from = cluster.getId()+":"+projectRoot + path;
    310310        job.setName("Copy " + jsonFiles.size() + " files from " + cluster.getId() + " to " + StringUtil.trimStringMiddle(basePath, 150));
    311311        job.setParameterValue("from", new StringParameterType(from.length(), null, true), from);
     
    316316        dc.commit();
    317317       
    318         CopyFilesToBase scp = new CopyFilesToBase(job, toDir, cluster, projectRoot +"/" + path, jsonFiles);
     318        CopyFilesToBase scp = new CopyFilesToBase(job, toDir, cluster, projectRoot + path, jsonFiles);
    319319        scp.setOverwrite(Boolean.TRUE.equals(jsonReq.get("overwrite")));
    320320        scp.setPreserveSubFolders(Boolean.TRUE.equals(jsonReq.get("preserveSubFolders")));
     
    381381    }
    382382    // Path must be at least two levels
    383     if (!path.matches("[a-zA-Z0-9._]+/[a-zA-Z0-9._].*"))
     383    if (!path.matches("/[a-zA-Z0-9._]+/[a-zA-Z0-9._].*"))
    384384    {
    385385      throw new InvalidDataException("Path must be at least two levels deep: " + path);
Note: See TracChangeset for help on using the changeset viewer.